TestProject Forum
Powered by leading experts in the test automation community

If-Else Logic, Operations, etc

I know there already is some capability to do if else with the “Visible Elements Operation” addon but I think it should be a whole separate step built into TestProject under “Element Action”, “Action”, and “Test”. Something to the effect of “If this, then run this test, else run this test,” etc. Right now the main way to do it is with recovery tests, but then you have to have a test step fail, which complicates the reports.

I’m quite new to TestProject though, so if I’m missing something let me know.

1 Like

Hi Snelzing.

Indeed, currently conditional logic can be implemented with Recovery tests and inverting step result.
But it can be configured the way that you will not see fails since recovery tests are now presented in reports as yellow-colored.

This is a forum post with guide for how to make this :

Also it can be easily done via coded tests using our SDK.

But later in this year we will release a new Recorder which will have much more possibilities.
Hope you will find this answer useful.

Thank you, I will have to play with step-inverting.

If u r reverting the step and after sometime the elements is visible, then the inverted will show as fail which is acutally wrong as the element can be dynamic

Hi @neehal.
Can you please elaborate about your use case and what you’re trying to achieve?
Also please ensure that you currently have the latest agent version installed, which is 60.2
https://app.testproject.io/#/download