TestProject Forum

Execute two groups

I want to execute group1 if condition is true and group 2 when condition is false.
to check the condition i am using action “Click if visible” and group 2 in recovery tests. but after execution of recovery test group 1 also executes. Please guide how to execute only one group?

@hafsa

To execute parts of your test selectively use the conditions option from the step advanced options:

Screen Shot 2021-06-14 at 15.43.52

Scroll to the bottom to find conditions section:

Screen Shot 2021-06-14 at 15.39.42

These conditions are based on parameters values.
Consider the following test for example:

Screen Shot 2021-06-14 at 15.40.51

Step #1 stores the value of the Full Name element, into the P1 parameter,
The following steps are condition-based and will be executed only if their conditions are true, otherwise, they will be skipped.

Refer to this documentation section for more information:

@marat thanks for reply. In case of p1 i am using a error message which has a button, I have to verify if error message appears then click the button and execute certain steps and else otherwise.

how to cater error message which appears on and off?

Is that a web or a mobile test? Are you referring to a Toast on Android?

You can use the Always Pass failure behavior on the Get Text step that inspects the error,
to avoid seeing the step failing when the error is not there:

Screen Shot 2021-06-15 at 11.16.57