SeleniumWebdriver

Extends Helper

SeleniumWebdriver helper is based on the official Selenium Webdriver JS library. It implements common web api methods (amOnPage, click, see).

Backends

Selenium Installation

  1. Download Selenium Server
  2. For Chrome browser install ChromeDriver, for Firefox browser install GeckoDriver.
  3. Launch the server: java -jar selenium-server-standalone-3.xx.xxx.jar. To locate Chromedriver binary use -Dwebdriver.chrome.driver=./chromedriver option. For Geckodriver use -Dwebdriver.gecko.driver=.

PhantomJS Installation

PhantomJS is a headless alternative to Selenium Server that implements the WebDriver protocol. It allows you to run Selenium tests on a server without a GUI installed.

  1. Download PhantomJS
  2. Run PhantomJS in WebDriver mode: phantomjs --webdriver=4444

Configuration

This helper should be configured in codecept.json or codecept.conf.js

Example:

{
   "helpers": {
     "SeleniumWebdriver" : {
       "url": "http://localhost",
       "browser": "chrome",
       "smartWait": 5000,
       "restart": false
     }
   }
}

Access From Helpers

Receive a WebDriverIO client from a custom helper by accessing browser property:

this.helpers['SeleniumWebdriver'].browser

Parameters