How do I immediately end the test
This example demonstrates how to end a test using exitTest command
In the solution shown below, the visibility of the Worksoft SaaS logo is stored using the storeVisible command into a variable after launching HICC. The value returned from "storeVisible" command is evaluated using an if block. If the value returned is false then the test will end immediately by using the exitTest command. If the value is true then the test will continue to execute the "type" command for entering the age in the 'Age' input field.
Solution:
# | Command | Target | Value |
---|---|---|---|
Store the visibility of an element | |||
1 | storeVisible | id="eureqalogo" | logo |
Evaluate the expression using if the condition | |||
2 | if | "${logo}"=="false" | |
If the logo is not visible on the page exit the test | |||
3 | exitTest | ||
End of the "if" block | |||
4 | endIf | ||
Enter the Age in the input field | |||
5 | type | id="txt_age" | 45 |
Tips, Tricks, Gotchas & Best Practices:
- The exitTest command is used to save the capacity in case if the main check fails and if you don't want to continue with the remaining workflow.