2017 © Pedro Peláez
 

library php-selenium-client

This library allows creating Selenium Server V2 tests in PHP. It communicates with the WebDriver API through the official JsonWireProtocol.

image

nearsoft/php-selenium-client

This library allows creating Selenium Server V2 tests in PHP. It communicates with the WebDriver API through the official JsonWireProtocol.

  • Friday, December 20, 2013
  • by jsantiago
  • Repository
  • 25 Watchers
  • 105 Stars
  • 40,497 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 39 Forks
  • 12 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

PHP-SeleniumClient

PHP interaction with Selenium Webdriver API, (*1)

Description

This library allows the interaction with Selenium Server V2 in PHP. It communicates with the WebDriver API through the official JsonWireProtocol., (*2)

One of the goals is to provide a client usage as close as possible to the Selenium Official libraries (such as Java's, c#'s). Most methods are named as the same as of these libraries'. In this way, whenever a developer runs into ideas or documentation in Java Client, the same techniques can be implemented by using this library., (*3)

Documentation

Version 2, (*4)

Version 1, (*5)

Quickstart

  • Start a session by creating an instance of WebDriver. By default, the test will run in firefox, (*6)

    $driver = new WebDriver();
  • As an alternative you can define desired capabilities for the session, (*7)

    $desiredCapabilities = new DesiredCapabilities("chrome");
    $driver = new WebDriver($desiredCapabilities);
  • Navigate by using the WebDriver::get method from the WebDriver Class, (*8)

    $driver->get("www.nearsoft.com");
  • Get elements from the DOM in current location, (*9)

    $textbox1 = $driver->findElement(By::id("someTextBoxId"));
    
    $button1 = $driver->findElement(By::cssSelector("html body div#content input#someButtonId"));
  • Manipulate located elements, (*10)

    $textbox1->sendKeys("Some text to send");
    
    $textbox1->getAttribute("value");
    
    $button1->click();
  • Find element within elements, (*11)

    $modal1->findElement(By::id("someModalId"));
    $listItems = $modal1->findElements(By::tagName("li"));
  • Switch between windows, (*12)

    $driver->switchTo()->window("windowName");
  • Manage alerts $alert = $driver->switchTo()->alert(); $alert->getText(); $alert->accept(); $alert->dismiss();, (*13)

  • Wait for elements to be present, (*14)

    $webElement = $driver->waitForElementUntilIsPresent(By::id("someElementId"));
    
    //or
    
    $wait = new WebDriverWait(8);
    $webElement = $wait->until($driver,"findElement",array(By::id("someElementId"),true));

The Versions

20/12 2013

dev-master

9999999-dev

This library allows creating Selenium Server V2 tests in PHP. It communicates with the WebDriver API through the official JsonWireProtocol.

  Sources   Download

Apache 2

The Requires

  • php >=5.3.8

 

testing selenium automation browser nearsoft

20/12 2013

v2.0

2.0.0.0

This library allows creating Selenium Server V2 tests in PHP. It communicates with the WebDriver API through the official JsonWireProtocol.

  Sources   Download

Apache 2

The Requires

  • php >=5.3.8

 

testing selenium automation browser nearsoft

29/10 2013

v1.5

1.5.0.0

This library allows creating Selenium Server V2 tests in PHP. It communicates with the WebDriver API through the official JsonWireProtocol.

  Sources   Download

Apache 2

The Requires

  • php >=5.3.8

 

testing selenium automation browser nearsoft

17/10 2013

v1.4

1.4.0.0

This library allows creating Selenium Server V2 tests in PHP. It communicates with the WebDriver API through the official JsonWireProtocol.

  Sources   Download

Apache 2

The Requires

  • php >=5.3.8

 

testing selenium automation browser nearsoft

08/10 2013

v1.3

1.3.0.0

This library allows creating Selenium Server V2 tests in PHP. It communicates with the WebDriver API through the official JsonWireProtocol.

  Sources   Download

Apache 2

The Requires

  • php >=5.3.8

 

testing selenium automation browser nearsoft