Drupal Testing: PHP: 08 - PHP Selenium

MOVE ON FROM SELENIUM 2... DO IT NOW & YOU WON'T HAVE TO LATER ( IT HAS MORE HOOKS & BUGFIXES )

facebook/WebDriver says it supports Selenium 2 & 3.. so will need to determine which classes/objects are pertinent to Selenium 3

  • Since Selenium-Server.jar is required....
  • JDK8 is required
  • does jenkins have the dependencies
  • is JDK8/jre in a place accessible by the Jenkins {WORKSPACE}.{PROJECT}.{BUILD} folder
  • MUST USE CORRECT VERSION OF SELENIUM 3
    • the facebook/webdriver package will mandate which version can be used
    • any conflicts with SUT source code & these packages?

 

https://github.com/facebook/php-webdriver

Getting started

Start Server

The required server is the selenium-server-standalone-#.jar file provided here: http://selenium-release.storage.googleapis.com/index.html

Download and run the server by replacing # with the current server version. Keep in mind you must have Java 8+ installed to run this command.

java -jar selenium-server-standalone-#.jar

NOTE: If using Firefox, see alternate command below.

Create a Browser Session

When creating a browser session, be sure to pass the url of your running server.

// This would be the url of the host running the server-standalone.jar
$host = 'http://localhost:4444/wd/hub'; // this is the default
Launch Chrome

Make sure to have latest Chrome and Chromedriver versions installed.

$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());

 

 

 

Tags