How to end a case when One of the two outcome is satisfied?

So basically I can get 2 different types of success message after an operation is done.
Even if I get one of the message… I want the test case to end. how can i do it.

I tried it with parallel but that just means other one will keep running even if I got one message

I’m looking for something like an OR gate

You can see in the image…

Hello @KD11

Use Element exists or Check app state activity to check the presense of those message. If either of that found ( use a if condition to check the existance)

Message1 and Message2 are the boolean output from element exist activity.

For example for the first messgae the output is “Message1” is True
Second messgae the output is “Message2” is False\

If(Message1 or Message2)
Then exit

@KD11

You can use the below doc for ending.

seems awfully long… isnt there a better way?

@KD11 Not in my idea now. As you need to check the existence of both the messages, you will have to use Element exists. Then to check the condition you will have to use an if condition. Then kill the process.

Maybe some other can provide another solution.

The two messages are “Operation completed” and “Operation completed with some warnings”

I’m thinking I’ll edit the message and only look for “Operation completed” as my anchor

what do you think?

Hi @KD11 ,

Have you tried using Regex in Selector Attributes, you can configure to Check for Either two of the messages that you would get. More on using regex in Selectors is provided below :

In this way, you wouldn’t need to use Two Check App State Activities.

1 Like

@KD11 Yes that is also possible. It depends on the message box you are going to check. Else if the message box is having some buttons, you can validate that also.

Then act on it.

unfo, no matter what happens, there will be an OK button… so cant validate on that…

rn im using the button as Target and The text as anchor