How to click item on screen using a changing variable

I am running on automation to identify whether or not a folder or item exists on the screen, and then click that item. Because this has to change item to item, regardless of name or position on screen, I was hoping to use a variable as an anchor. However, I cannot get it to validate. Below I have attached an example of what exactly I am attempting to do, click the folder symbol near the corresponding folder.

Because this is an iteration, it has to do this multiple times with different folders on different places.

image

Hi @coby.smith ,

Try Indicating the Element using UiExplorer and Check if you are able to Validate and get the Selector for the Element.

Hello @coby.smith

So do you need to click on each Folder as a loop and to do some action??

If yes, you need to find attributes like idx or rownum which gives the position of the item, that helps

Yes, I will need to select the item, and if they have items within them, clicking that folder icon will allow me reference them. What should I use to get that information?

All elements shown validate correctly on their own, but when the anchor’s information is substituted with the variable I will be using it does not validate.

Can you try with find children activity.

Also inspect on folder with item and without item using uiexplorer and see whether any specific attribute is giving this detail.

Thanks

@coby.smith , Try providing a default value to the variable and check if it validates in that case.

If the default value is empty it would not validate. But at Run Time it should be assigned with a Value and it should the element should be a Match.

This has been attempted. Unfortunately, adding a default value still causes these errors to occur.

@coby.smith ,

Could you provide Screenshots of the Selector when it is Validated and when it is not Validated (used a Variable with Default Value) ?

Do use UiExplorer and send the Screenshots if possible.


Here it is as normal. The folder icon is the target, and aaname=‘Folder A’ is the anchor.

For some reason I’m having trouble inserting variable into aaname

@coby.smith ,

Do opt only for Strict Selector and use UiExplorer to Check the Selector Validation.

I do not think there is a need for Fuzzy and Image Selectors.

Do perform this change and Check if it is able to work.

Note: Always use UiExplorer to Check the Selector Validation and Highlight the element .

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