Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Vagrantfile
bootstrap.sh
readme.md
test.js

readme.md

#About

This repository is for automatically deploying and executing the test code for WebdriverIO's getting started guide using the current set of directions, which do not instruct the user to use geckodriver with selenium server. I created this repository to demonstrate the error a user will get when executing the test script in the getting started guide for webdriverIO. To accomplish this, I am using Vagrant and VirtualBox

Executing the code in this repository will:

  1. Create a new virtual machine running Ubuntu.
  2. Provision the machine with of all of the necessary software dependancies.
  3. Start Selenium Standalone Server 3.0.1 using geckoDriver for firefox
  4. Execute the test code shown in the getting started section of WebdriverIO's guide and print the results on the command line.

The code that will be executed:

var webdriverio = require('webdriverio')

var options = {
  desiredCapabilities: {
    browserName: 'firefox'
  }
}

webdriverio
  .remote(options)
  .init()
  .url('http://www.google.com')
  .getTitle().then(function (title) {
    console.log('title was: ' + title)
  })
  .end

#Setup

  1. Download and install the latest versions of VirtualBox and Vagrant.

  2. Clone this repository (or download and unzip manually)

    git clone https://github.com/jcreager/webdriverio-getting-started.git
    
  3. Open a new terminal or command line window and navigate to the downloaded repository

    cd /path/to/webdriverio-getting-started
    
  4. On the command line execute the following command:

    vagrant up
    

    The program execution will take several minutes as the dependancies are downloaded and installed. You will know that this was successful if the very last line printed to the console is:

    Driver info: driver.version: unknown
    ...
    WARN - Exception: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
    

    Note: This will error silently because the output of selenium is redirected to log.txt. To view the full contents of log.txt, do the steps below:

    vagrant ssh
    cat ~/webdriverio-test/log.txt
    

#References

  1. Running Selenium with a Virtual Display
  2. Install Oracle Java 8 on Ubuntu