How to verify the conditions?

Hi All,

I want to verify the condition in a website as follows:

  1. If the keyword UATSignOff is present or not if present need to click on UATSignOff link if not need to throw the business exception.
  2. If the keyword LOGs.txt is present or not if present need to click on LOGs.txt link if not need to throw the business exception.
  3. If the keyword TestInput_TestResults.zip is present or not if present need to click on TestInput_TestResults.zip link if not need to throw the business exception.

Please guide me how to achieve this the above mentioned key words are sometime present some time may not present.

Thanks in advance

@ashokkarale
@ppr
@Yoichi
@Anil_G
@mkankatala

You can use Switch for checking any of the above condition, in switch any one of the value is found it will execute that sequence.

@naveen.s

  1. If you need to check for them separately then just use 3 check app states one for each
  2. If you know only any one would present then use parallel activity…and use all 3 at a time and use the parallle activity condition with output of check app statr and perform click accordingly on found side and use throw business exception

Cheers

@naveen.s,

As suggested by Anil, Check app state would be the best approach here.

Thanks,
Ashok :slight_smile:

@Anil_G ,

I need to check them separately.

If I use the Check app state will it works for the below conditions??

Like: If the keyword can present in any of the lines its not constant i.e

UAT sign.doc
Testing logs.xlsx
Deployment document.xlsx
Code review.xlsx

the above four key word position can be inter changed that and few time there will be more than 4 keywords but its constant.

How to handle that??

Hie @naveen.s so for this you can use switch condition to check you extract result have any one value from these 3 condition if not then you can throw a business exception.
hope this screenshot help you


or else you can use if condition
image
image
use if inside if and in the last else if no value found you can throw business Exception…

cheers Happy Automation :smile:

@Anil_G ,

I tried the same as you suggested but my question is:

I used 3 Check app for each keyword like “UATSignOff”, “LOGs.txt”, “TestInput_TestResults.zip”.

but if the first condition false then bot is throwing the business exception after throwing that bot is stopping its execution, but I dont want the bot to stop after first condition irrespective of the results whether the condition is true or false, the bot should check all the 3 conditions.

Can you please suggest me in this??

@ashokkarale

@naveen.s,

1.Declare 3 Boolean variables to hold every UI element you are looking for.
2. Use parallel activity. Use 3 check app state. In element exist sequence add assign activity to mark the Boolean variable true.
3. After parallel activity, use if or else if to check your condition.

Thanks,
Ashok :slightly_smiling_face:

@ashokkarale ,

I didn’t get it, can you please build a sample workflow for the same??

@naveen.s,

This way I was talking about. Could not share the xaml.

Thanks,
Ashok :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.