Created
November 26, 2010 20:10
-
-
Save everzet/717169 to your computer and use it in GitHub Desktop.
SahiDriver PHP example
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
<?php | |
require_once '/sahi/driver/path/autoload.php.dist'; | |
use Everzet\SahiDriver; | |
$connection = new SahiDriver\Connection('@@SAHI_SESSION_ID@@'); // replace with your custom session ID | |
$browser = new SahiDriver\Browser($connection); | |
$browser->navigateTo('http://shopopensky.com/'); | |
$browser->findLink('Join')->click(); | |
$browser | |
->findTextbox(null, array('under' => $browser->findLabel('First name:'))) | |
->setValue('Konstantin'); | |
$browser | |
->findTextbox(null, array('under' => $browser->findLabel('Last name:'))) | |
->setValue('Kudryashov'); | |
$browser | |
->findTextbox(null, array('under' => $browser->findLabel('Your email address:'))) | |
->setValue('everzet@example.com'); | |
$browser | |
->findTextbox(null, array('under' => $browser->findLabel('Create a password:'))) | |
->setValue('qwerty'); | |
$browser->findSubmit('Create My Account')->click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment