About
The CubicTest Selenium Exporter Plugin runs tests directly in the CubicTest graphical test editor using an embedded version of Selenium RC. No setup is necessary, and the target server does not have to be instrumented. Using this plugin is the preferred way to run tests in CubicTest.
The plugin can also export to Selenium Core HTML tables for running tests with an external Selenium installation.
The plugin is written and maintained by the CubicTest team. It is also has a Maven 2 plugin based on it.
Features
- Supports the entire CubicTest test model (all identifiers, actions and contexts).
- Gives you direct feedback by coloring the test model.
System requirements
- Either IE, Firefox, Opera, Google Chrome or Safari must be installed.
TIP: Use Google Chrome for running tests, as it starts faster and looks better in multiwindow mode. Default browser for your tests can be changed in the file test-project.properties in your CubicTest project.
How to use
Running the tests directly in the GUI
- Create/open a test
- Right click in test editor -> choose "Run As" -> "Run CubicTest with Selenium".
This opens a browser and runs the tests. The results are shown in the test model. Green = pass, red = fail, orange = exception - Click "Reset test-run" to remove the coloring of the test.
Exporting to Selenium Core files
Alternatively, the tests can be exported to separate Selenium Core HTML files for running in an existing Selenium installation:
- Create/open a test
- Right click in test editor (or on the file in the package explorer) -> choose "Export to Selenium Core test script"
The generated files are placed in the "generated" subfolder of the test project (found in the package explorer).
Limitations
- Options in SelectLists do not support more than one identifier, and no modifiers (e.g. "begins with") when Options are used for user interactions (though it is supported for asserting presence).
Using a custom Firefox profile
To use a custom Firefox profile (e.g. to turn off some security setting), you must
- Download Selenium Remote Control from seleniumhq.org
- Create a new Firefox profile (see below)
- Start the Selenium Server and tell it to use the created Firefox profile (see below)
- In the CubicTest Launch Configuration dialog (Run As -> Run Configurations... -> Use/create a CubicTest launcher) set the Selenium Server hostname/port of the started Selenium Server, and CubicTest will use that Selenium Server instead of starting its own.
When launching from JUnit, step 4) from above must be applied to the setter methods on the SeleniumRunner instance in JUnit.
For how to create and use custom Firefox profiles, check out the Selenium RC documentation:
http://seleniumhq.org/docs/05_selenium_rc.html#specifying-the-firefox-profile
In short, you must use a Firefox tool to create a custom profile and start your Selenium Server with the command line option -firefoxProfileTemplate c:/pathToYourProfile
Running tests through a proxy server
The use of proxy servers is currently not supported in CubicTest.
Nevertheless, you can try setting the correct proxy server in your operating system properties (e.g. in Windows -> Control Panel -> Internet Options -> Proxy Servers).
Then use "Internet Explorer" (or an OS native browser) as your browser for running tests.
For recording you can always change the proxy settings in the actual recording-session browser manually.
You can also try starting your own selenium server and configure the proxy settings there and tell CubicTest to use that Selenium Server instead of starting its own (see above). Check the Selenium RC documentation. Tests winter 2010 was not successful using this approach on Vista.
If Firefox is installed in a location other than the default one...
Set the PATH variable of the operating system to include the folder where the firefox binary is located.
Selenium User-Extensions
http://seleniumhq.org/docs/08_user_extensions.html
To use Selenium User-Extensions:
- Manually start a Selenium Server instance:
java -jar selenium-server.jar -userExtensions user-extensions.js - Point to this Selenium instance from Cubictest in the test configuration screen.
