Nuxeo Core Developer Guide

WebDriver Tests

Updated: October 22, 2018 Page Information Edit on GitHub

Compatible Firefox Location

Webdriver tests run on selenium 2.53.0 and they pass on Firefox 26 to 46 included. You can use the following system property while running the tests to make Webdriver use the correct Firefox:

-Dwebdriver.firefox.bin="/path/to/firefox/binary"

Webdriver tests can be launched from eclipse like any other unit tests. You can add the above system property to the JRE of your eclipse:

  • Go to 'Windows' -> 'Preferences' -> 'Java' -> 'Installed JREs'
  • Edit the default JRE
  • Add

    -Dwebdriver.firefox.bin="/path/to/firefox/binary"

    to the Default VM arguments

Running Tests Headless

If you want to run the tests without being disturbed by the Firefox windows opening and closing, under Linux, you may use:

xvfb-run -s "-screen 0 1920x1080x8" myCommand

Where:

  • -s "-screen 0 1920x1080x8" specifies a screen resolution. Note that without it, the resolution may be too small and your tests may fail because it cannot reach some graphical interface widgets.
  • myCommand is the command to be executed in this virtual frame buffer. E.g.: mvn integration-tests -Dwebdriver.firefox.bin=/path/to/firefox/binary.

Screenshot

On failure, a screenshot of the web page is captured and stored in the target directory.

Logging

It is possible to enable WebDriver logs when running tests. To do so, you need to pass a Environment Variable when running the tests:

nuxeo.log.webriver=true

As a result, WebDriver will log the driver connection details in the target directory. This also works in Jenkins by configuring a specific job and checking "Set environment variables" box in the "Build Environment" section.

2 months ago manonlumeau NXDOC-1650 fix about integrating changes, add mention on multiple attempts
2 years ago Antoine Taillefer 11
3 years ago Ronan Daniellou 10 | Added missing title for section Firefox location
3 years ago Ronan Daniellou 9 | Fixed layout + added Nuxeo TOC
3 years ago Ronan Daniellou 8 | Added a section about xvfb for running headless
4 years ago Guillaume Renard 7
4 years ago Guillaume Renard 6
5 years ago Solen Guitter 4
5 years ago Solen Guitter 5
5 years ago Guillaume Renard 3
7 years ago Anahide Tchertchian 1
7 years ago Anahide Tchertchian 2 | Migrated to Confluence 4.0
History: Created by Anahide Tchertchian

We'd love to hear your thoughts!

All fields required