-
-
Save generalredneck/3659575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: google | |
I want to search something on google | |
Scenario: Search something on google | |
Given I am on "/" | |
And I fill in "q" with "selenium" | |
When I press "Google Search" | |
And I click the first link | |
Then I should see "selenium" | |
public function iClickTheFirstLink() | |
{ | |
$url = $this->getSession()->getCurrentUrl(); | |
echo $url . " 1\n"; | |
$driver = new \Behat\Mink\Driver\Selenium2Driver('firefox', 'http://www.google.com'); | |
$session = new \Behat\Mink\Session($driver); | |
$session->start(); | |
echo $session->getCurrentUrl() . " 2\n"; | |
$session->visit($url); | |
$session->wait(3000); | |
echo $session->getCurrentUrl() . " 3\n"; | |
$first_link = new NodeElement("//ol/li[1]/div/h3/a", $session); | |
$first_link->click(); | |
$session->wait(3000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment