TestProject Forum

OR with an Is Present?

Is there an easy way to implement is x OR y present/visible/clickable/etc?

there are several, can you shade some light what is your test scenario ?

After clicking a link, there’s two different possible websites it can go to. I want it to check for an is present element on one page OR the other, that way the test won’t fail if I only do one of them.

and these are the only steps that you want to check on both sites or there will be more steps (XX steps in case it’s URL A and YY steps after in case its URL B)?

That’s all I want to check and then I’ll return to the main website.

And then more steps on the main website, but not either of those URLs.

the simplest way to do will be recording a step for validation (can be is visible/is present) on URL option A, then on the advanced step setting adding recovery test (sub test with a single validation step on site B), then after recovery test complete choose continue

The other way will be using Get current URL action with a combination of - if/else

first step add the Get current URL action and store the URL value in a parameter (MyURL in this example)

then go to the validation step (if visible), open the advanced section and add if statement like this

that will flag to TestProject to run this step only if MyURL == google.com , otherwise the step will be skipped (not failed)

now do the same for a second validation step but no add if MyURL==xxx.com

hope it make sense