Many IFS, what is the best practice

Hi,

I get an variable from a file. If the variable = x, then I have to click on one thing, if = y then in different. I have 16 such conditions.

I tried with switch but i cant figure out how to do this.

Any advice?

Best Regards,
Marek

Hi,

It might be able to achieve by single Click Activity with dynamic selector, but it depends on your requirement and/or environment. Can you find any rule between your variable and selector of click activity?

Regards,

@Marek_Matuszak, Yes a switch is what you need

What challenges specifically did you have with the switch?

I know what should be in activity and I dont know how to write:

if ServiceID = “imps-c:p01” then click on something
if ServiceID = “imps-c:p02” then on something else
etc.

@Marek_Matuszak
You can use single click activity based on input.
E.x.

<html app='chrome.exe' title='test' />
<webctrl tag='INPUT' cls='inputArgument' />

here inputArgument will be your selection criteria.

OR

If you are using switch activity

Create case and add activity in front of it.
If case is imps-c:p01 click this
If case is imps-c:p02 click that.

You can add activity for each case

Hi,

I started doing the second solution. I have one more question. What should be in default in switch activity?

@Marek_Matuszak
Yo can leave default as blank or can use a write line/ logs to understand in which scenario bot will come to default case.
Hope this will help you.

Thanks a lot <3

1 Like