Test Plugin

From Clickframes

Contents

Selenium IDE configuration

The tests generated by the test plugin use selenium extensions. In order to run these tests from Selenium IDE you need to add these extensions to Firefox first.

Goto Tools -> Selenium IDE -> Options -> Selenium core extensions -> Browse

Select the file present at the following location on your disk (you may need to get the clickframes source code before performing this step):

clickframes/core/src/main/resources/user-extensions-ide.js

Restart firefox after making the above change.

Generating tests

Include the following in your techspec.xml

<plugin class="selenium" />

And run:

mvn clickframes:generate

Tests will be generated in src/test/selenium/clickframes/

Suites can be identified as files ending with ...suite.html

Preparing tests

Prepare all tests

mvn clickframes:prepare-tests

The "master-suite.html" is generated here:

target/clickframes/selenium/all/tests/master-suite.html

Prepare tests for page with id="register"

mvn clickframes:prepare-tests -Dclickframes.regex=pgregister

The "master-suite.html" is generated here:

target/clickframes/selenium/regex/tests/master-suite.html

Prepare "verifyPositive" tests for page with id="register"

mvn clickframes:prepare-tests -Dclickframes.regex=pgregister.*verifyPositive

The "master-suite.html" is generated here:

target/clickframes/selenium/regex/tests/master-suite.html

Executing tests

Manual execution using Selenium IDE

You can execute the tests by opening the master-suite.html in the IDE.

Automatic execution

Tests can be executed from command line as follows:

mvn clickframes:execute-tests

You can prepare and execute with a single command:

mvn clickframes:prepare-tests -Dclickframes.test=pgregister.*verifyPo clickframes:execute-tests -Dclickframes.baseUrl=http://localhost:8080/tracker/

Test profiles

You can select a profile by

mvn clickframes:prepare-tests -Dclickframes.profile=<profile name>

Each test run may load properties which can be used to customize tests for a specific environment, browser etc. Properties are loaded from the following locations, in this order:

  1. <project basedir>/src/test/testbed/applicationInitialize.properties
  2. <project basedir>/src/test/testbed/<hostname>/<profile name>.properties
  3. USER_HOME/.<appspec id>/testbed/<profile name>.properties

Notes:

  • Default <profile name> is "default".
  • Properties found in latter file will override the same property loaded from a previous file
  • If a file is not found, it is not considered as an error
  • Default value of the "browser" property is "*firefox"
  • To specify a browser path, use browser="*firefox /path/to/firefox-bin"
  • "baseUrl" is required
  • You can specify "browser" through command line by using clickframes.browser property
-Dclickframes.browser="*firefox /opt/firefox/firefox-bin"
  • You can specify "baseUrl" from command line by using clickframes.baseUrl
-Dclickframes.baseUrl="*firefox http://localhost:8080/app/"
  • baseUrl should end in a '/'