Dynamic selector with multi condition

Hi Friends,

I have query -

I am working on website, where I need to click on check box but condition is, date should be 11/20/2024 and Treatment should be Fever. If condition match then only click on check box. I am sharing excel data for test.

See below screenshot:

2 enteries for same date with different treatment, so I need to click on whose treatment is fever and date equals to 11/20/2024.

Date should be dynamic

I have data in excel and compare with web and click on check box.
Selector query.xlsx (8.6 KB)

Hi @Jeeru_venkat_Rao

You can see below solution:

In a loop you can use the expression: CurrentRow.Item(“Treatment”).ToString = “Fever” and CurrentRow.Item(“Date”).ToString = Now.ToString(“MM/dd/yyyy”)


Regards.

so in this case, how my check box select matching condition?

Please elaborate

I m begginer so not get understand properly.

What type of a checkbox do you have? You can do the operation in If condition. What is the main problem about selecting checkbox? Maybe you can explain your problem detaily.

I will be very happy if i help you :slight_smile:

image

See above screenshot.
My question is - how selector know where to check?

This is selector code

Ok then,

İf the selector of checkbox has rowId or idx, you should first set up a while loop to iterate every row. In the loop you can control the Date and Treatment column with İf condition. İf the condition matches with values you want, then you can identify the current row id. (You can initialize a variable for rowId as 0 or 1 before the loop and you should increase the value of the variable for every iteration) After that you can use this row id to select correct checkbox.

Hope this helps.

Hi @Jeeru_venkat_Rao


if the above is actually in website
You can use for each ui element activity then as an ui element keep select the check box and as a label select the date

Try this !
Hope this helps!