Php-webdriver

Selenium Webdriver bindings for PHP

Download .zip Download .tar.gz View on GitHub

Introduction

This is a fork of PHP WebDriver bindings
This is site for developers of PHP bindings for Selenium WebDriver. This PHP library allows creating functional webdriver tests with PHP.

Details

Library comunicates with Selenium Server using JsonWireProtocol. Requires curl in PHP. List of implemented methods: implemented_methods.

Example


   require_once "WebDriver.php";

   $webdriver = new WebDriver("localhost", "4444");
   $webdriver->connect("firefox");                            
   $webdriver->get("http://google.com");
   $element = $webdriver->findElementBy(WebDriver::LOCATOR_NAME, "q");
   $element->sendKeys(array("webdriver" ) );
   $element->submit();

   $webdriver->close();

Combobox handling


   $this->webdriver->get($this->test_url);
   $element = $this->webdriver->findElementBy(WebDriver::LOCATOR_NAME, "sel1");
   $option3 = $element->findOptionElementByText("option 3");
   $option3->click();
   $this->assertTrue($option3->isSelected());

   $option2 = $element->findOptionElementByValue("2");
   $option2->click();
   $this->assertFalse($option3->isSelected());
   $this->assertTrue($option2->isSelected());