Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Command Line Interface

jvanderwee edited this page Dec 7, 2014 · 3 revisions

Tests can be executed by running mvn clean verify followed by any properties you wish to specify.

Properties

Property Description Values
browser The browser on which you wish to run the tests. Defaults to phantomjs if not specified. firefox, chrome, safari, ie, opera, phantomjs, android
build The build version or app version to log to Sauce Labs. Not mandatory and is only taken into consideration when running on Sauce Labs. build-1234
browserVersion The browser version on which you wish to run the tests. Not mandatory and is only taken into consideration when running remotely e.g. on Selenium Grid or Sauce Labs. e.g. 8.0
deviceName The device on which you wish to run the Appium tests. Mandatory when using Appium. iPhone Simulator, iPad Simulator, iPhone Retina 4-inch, Android Emulator, Galaxy S4, etc….
groups The TestNG test groups which you wish to run. All tests groups will run if not specified. e.g. checkintest
platform The platform on which you wish to run the tests. Is only taken into consideration when running remotely e.g. on Selenium Grid or Sauce Labs and is mandatory when using Appium. e.g. windows, ios, android
platformVersion The platform version on which you wish to run the tests. Is only taken into consideration when running remotely e.g. on Selenium Grid or Sauce Labs and is mandatory when using Appium. e.g. 5.0
sauceUser Your Sauce Labs username. Mandatory if you wish to run on Sauce Labs.
sauceKey Your Sauce Labs access key. Mandatory if you wish to run on Sauce Labs.
seleniumGridURL The URL of your Selenium Grid hub. Mandatory if you wish to run your tests on your Selenium Grid. e.g. http://localhost:4444/wd/hub
threads The number of threads to use. Defaults to 1 if not specified. e.g. 3

Examples

Running web tests using PhantomJS:

mvn clean verify -Dbrowser=phantomjs

Running web tests on Firefox 34.0.5 with Selenium Grid:

mvn clean verify -Dbrowser=firefox -DbrowserVersion=34.0.5 -DseleniumGridURL=http://localhost:4444/wd/hub

Running mobile web tests on iOS 8.0:

mvn clean verify -DsauceUser={username} -DsauceKey={accessKey} -Dplatform=ios -Dbrowser=safari -DplatformVersion=8.0 -DdeviceName="iPhone Simulator"
Clone this wiki locally