
Untitled
By: a guest on
May 6th, 2012 | syntax:
PHP | size: 0.99 KB | hits: 15 | expires: Never
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class Example extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://www.facebook.com/");
}
public function testMyTestCase()
{
$this->open("/");
$this->type("email", "<username>");
$this->type("pass", "<password>");
$this->click("//input[@value='Login']");
$this->waitForPageToLoad("90000");
for($i=0; $i<1000; $i++) {
$this->click("link=Profile");
$this->waitForPageToLoad("90000");
$this->click("//a[@href='http://www.facebook.com/sp2hari?sk=friends&v=friends']");
$this->waitForPageToLoad("90000");
$this->click("//div[@class='fbProfileLargePortrait']/a/");
$this->waitForPageToLoad("90000");
$this->click("link=Unfriend");
sleep(5);
$this->click("remove-friend");
$this->waitForPageToLoad("90000");
}
}
}
?>