You can automate test runs in the CrossBrowserTesting cloud by using command-line parameters or via COM, or you can run them from your Jenkins builds.
Command Line
To command TestComplete to run tests in CrossBrowserTesting environments from the command line, use the /cbt command-line argument.
For example:
TestComplete.exe "C:\Work\My Projects\MySuite.pjs" /r /cbt
COM
If you control TestComplete test runs via COM, use the Integration.RunEnvironmentManager
method to command TestComplete to run tests in CrossBrowserTesting environments. To learn more, see the method description.
Jenkins and Other CI Systems
To initiate a test run from a Jenkins build:
-
On every node you will use for running these tests, start TestComplete, open any project suite (or create a new one) and specify CrossBrowserTesting credentials. See Prepare Jenkins Nodes to Run Tests in CrossBrowserTesting Environments.
-
Select to run CrossBrowserTesting tests in properties of the TestComplete Test build step.
To run CrossBrowserTesting tests from an arbitrary continuous integration (CI) system, you can run TestComplete from the command line (see above). Before running tests, run TestComplete on the CI agents (nodes) and specify a CrossBrowserTesting account in TestComplete (similar to what you do for Jenkins).
TestComplete associates CrossBrowserTesting account data with a Windows user account. So, it is important that you log in to the agent (node), set the CrossBrowserTesting details and run the tests later under the same Windows account.
Notes
-
You can initiate test runs in CrossBrowserTesting environments only from TestComplete. TestExecute does not support running tests in CrossBrowserTesting environments.
-
Whatever automation type you choose, TestComplete will run all the enabled tests of all the environments enabled in the project suite.
-
When automating TestComplete test runs, you can set a test timeout - a time period for which TestComplete waits for tests to finish:
-
If you run tests from the command line, you use the
timeout
command-line argument. -
If you run tests from Jenkins, you use the Use test timeout property of the TestComplete Test build step.
-
If you run tests via COM, you can write custom code that will pause your client execution until the test run is over.
When specifying a timeout period, keep in mind that it includes not only the test run time, but also the startup time of CrossBrowserTesting environments and TestComplete.
If the test run is not over after the timeout elapses, TestComplete will post an error to the test log and stop the test run.
-
TestComplete 32-bit executable is located in the <TestComplete>\Bin folder.
TestComplete 64-bit executable is located in the <TestComplete>\x64\Bin folder.
See Also
Integration With CrossBrowserTesting.com
Running Tests in CrossBrowserTesting Environments