Acceptance testing/Browsers

Jump to: navigation, search

This page complements Acceptance testing providing info about how to run the acceptance tests suite in different browsers.


There are Selenium drivers ( to run acceptance tests in different browsers:

Each driver should be downloaded and Selenium .jar should be started specifying the path to the driver; depending on the driver there could be other requirements.


PhantomJS is different as it is a headless browser as it is quite faster than other drivers, it doesn't need a GUI to run and can execute JS, it doesn't even need to be used through Selenium (you can do it though, but it's not officially supported) and you can do it

Note that 4444 is the default port used by Selenium so you must specify another one if you want to run them together and specify the port in $CFG->behat_config.


 # Selenium in Linux (firefox by default + chrome)
 java -jar /opt/selenium-server-standalone.jar
 # Selenium in OSx (firefox & safari by default + chrome)
 java -jar /Users/moodle/Downloads/selenium-server-standalone.jar
 # Selenium in Windows (started using git bash) (firefox by default + chrome + internet explorer)
 java -jar /c/seleniumdrivers/selenium-server-standalone.jar
 # PhantomJS
 /path/to/your/phantomjs/bin/phantomjs --webdriver=4444


Not all the drivers can execute all of Moodle's step definitions; we tagged the step definitions that are using features not supported by all browsers and also limitations that some browsers have; refer to the following table to know which browsers can run which tags:

File uploads (@_file_upload) Browser dialogs (@_alert) Switch window (@_switch_window) Switch frame (@_switch_iframe) Bug in phantomjs (@_bug_phantomjs)
Firefox Yes Yes Yes Yes Yes
Chrome Yes Yes Yes Yes Yes
Internet Explorer Yes Yes No Yes Yes
Safari Yes No No Yes Yes
PhantomJS No No Yes Yes No

Working combinations of OS+Browser+selenium

As OS, Browsers and Selenium keeps updating, some combination of OS+Browser+Selenium will not work on specific moodle version.

We try to support the latest version of these combinations but they are not always BC and hence may not work with older releases. Please refer to Acceptance testing/Browsers/Working combinations of OS+Browser+selenium to ensure you have correct combination of them to run acceptance test.