Select item activity and for each

Hello everyone!
I want to find an element using the “Select Item” and For Each (if impossible, Do While or just If) activities in order. It’s like select 1 item and look for the text(using the Check Element)if there is no text in it, go for select a specific item and if there is a text it stops.
There are like 15 items in selecting box.
Please help.

Regards,
Temuulen

I don’t know which one I have to use

select item is used when there is a drop down menu

If there is one particular element you want to check then use “get text” , if you want to check if element is there or not use “element exists”

Regards

Hi @Temuulen_Buyangerel ,
Can you share your image?
I think you want to select 1 item from dropdown list menu , that is right?
Regards
LNV

Hi, I’m using “Check Element” so if there is not, It should go for next(not in an order like first one is 3rd item of the menu and second is 7th) item of the dropdown menu.

Hey,
Yes, after that checking an element and if there is, it stops.
I can’t upload image for some reason.

Hi @Temuulen_Buyangerel ,
You can try


Hope it help
Regards,
LNV

1 Like

Thank you!
I’ll try.

regards,
Temuulen

1 Like

@Temuulen_Buyangerel

Use Get full text activity and store it in a string variable indicate on a dropdown
Take an array_Var=Split the text using the split function
Use select item in that you give CurrentItem
Take check app state to check it has text or not
If text present:perform action
else
break

Your action

1 Like

Hi @Temuulen_Buyangerel

  1. Use the “Select Item” activity to select the first item from the dropdown list.
  2. Use the “Check Element” activity to check if there is text in the selected item.
  3. If there is no text in the selected item, proceed to the next item using a loop (For Each, Do While, or If).
  4. If there is text in the selected item, stop the loop and proceed with further actions.

Hope it helps!!

1 Like

Hey @Temuulen_Buyangerel ,
You can use Get attribute activity and choose the appropriate attribute
You get all the items from the dropdown as a collection
You can then use an if activity and assign the condition as attributeVar.contains(yourVar)

hope it helps you

1 Like

@Temuulen_Buyangerel

Give a try the above given process, I hope it works for you

1 Like

Thank you!
I’ll let you know after try them all.

Is it able to write on item’s name “select item” activity instead of selecting?

Hi @Temuulen_Buyangerel - Another simple approach would be, Select Item activity throws an exception saying Item Not Found when it not able to find an item

So, you can enclose the Select Item activity in a Try Catch block, if there is an exception means, there is no item found, then retry the same activity to select the next item, else, item exists

1 Like

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