GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Nearsoft/php-selenium-client: PHP interaction with Selenium Webdriver API

BranchesTags
Open more actions menu

Latest commit

 

History

116 Commits
116 Commits

Folders and files

NameName
Last commit message
Last commit date
demo
demo
 
 
src/Nearsoft/SeleniumClient
src/Nearsoft/SeleniumClient
 
 
test
test
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

PHP-SeleniumClient

PHP interaction with Selenium Webdriver API

##Description

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

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.

##Documentation

Version 2

Version 1

##Quickstart

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

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

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

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

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

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

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

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

  • Wait for elements to be present

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

About

PHP interaction with Selenium Webdriver API

Resources

Readme
Activity
Custom properties

Stars

109 stars

Watchers

22 watching

Forks

38 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.