Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: PHP  |  size: 0.99 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
  3. class Example extends PHPUnit_Extensions_SeleniumTestCase
  4. {
  5.   protected function setUp()
  6.   {
  7.     $this->setBrowser("*chrome");
  8.     $this->setBrowserUrl("http://www.facebook.com/");
  9.   }
  10.   public function testMyTestCase()
  11.   {
  12.     $this->open("/");
  13.     $this->type("email", "<username>");
  14.     $this->type("pass", "<password>");
  15.     $this->click("//input[@value='Login']");
  16.     $this->waitForPageToLoad("90000");
  17.     for($i=0; $i<1000; $i++) {
  18.         $this->click("link=Profile");
  19.         $this->waitForPageToLoad("90000");
  20.         $this->click("//a[@href='http://www.facebook.com/sp2hari?sk=friends&v=friends']");
  21.         $this->waitForPageToLoad("90000");
  22.         $this->click("//div[@class='fbProfileLargePortrait']/a/");
  23.         $this->waitForPageToLoad("90000");
  24.         $this->click("link=Unfriend");
  25.         sleep(5);
  26.         $this->click("remove-friend");
  27.         $this->waitForPageToLoad("90000");
  28.     }
  29.   }
  30. }
  31. ?>