Skip to content

Instantly share code, notes, and snippets.

@everzet
Created November 26, 2010 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save everzet/717169 to your computer and use it in GitHub Desktop.
Save everzet/717169 to your computer and use it in GitHub Desktop.
SahiDriver PHP example
<?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