Script development
Test script is a frontend automation script that mocks participant actions using
Selenium. It is one of the main factors which determines successful test runs.
This script must be written in
JavaScript+Nightwatch.js as a function that accepts
a single parameter (usually browser
or client
);
Java+TestUI as a public void
function
or Python+Py-TestUI as a function
with name that starts with test
, and accepts single parameter named driver
.
Check the examples below:
- JavaScript + Nightwatch.js
- Java + TestUI
- Python + Py-TestUI
client => {
// Nightwatch.js function code goes here
}
public void myFunction() {
// TestUI function code goes here
}
def test(driver):
# Py-TestUI function code goes here
More examples can be found here.
Script execution time and participant timeout
When you're creating a test, one of the test parameters is the participant timeout. The participant timeout parameter determines the maximum permitted running time of a participant. This means that if for any reason the participant has been executing the test for longer than the allotted participant timeout value, then that participant will be terminated. The participant timeout is used to resolve situations where a participant may unexpectedly be frozen or stuck in execution longer than planned.
Participants that stopped executing the script due to timing out will be characterized in the run report by a "timeout" status.
A common misconception is that the script will be looped until the participant timeout is reached - this is not true. The script will be executed once and any looping needs to be implemented directly in the script by the user.
Make sure that the participant timeout is set to a value higher than how long the script is expected to execute.
The timer for each participant is separate because participants will start execution at different moments (see: start interval and increment strategy parameters), and this timer will only begin counting down once the participant actually begins executing the script. If one participant times out, the remaining participants will not be affected unless their individual timers also exceed the participant timeout value.