Lesson 6 Practice 1 Walkthrough question regarding selectors (relative elements)


#1

In the walkthrough there is a section where select relative element activities are used.

You are asked to go to the rpachallenge webpage

http://www.rpachallenge.com/

and using Ui Explorer you are to select the name field and then use the select relative element function to select the First Name label and then change the selector.

I don’t really follow why ‘obviously’ the id attribute needs to be removed.

Can anyone please clarify.


#2

Hi @charliefik,
the challenge states: “Beware! THE FIELDS WILL CHANGE POSITION ON THE SCREEN after every submission, throughout 10 rounds, thus the workflow must correctly identify where each spreadsheet record must be typed every time.” So you will need dynamic selectors to make your workflow more flexible, and the “Id” attribute should be removed as it specifies the exact location of the field on the screen. You can compare the Id attributes of the “First Name” field for various screen variants shown each time after you click ‘Submit’ - they can be ‘8iydD’, ‘Qxssj’, ‘hanus’ etc, depending on where that field is placed on the screen.
I hope this explanation helps.


#3

Thanks very much @PAD I’ll work on my reading! That makes perfect sense.

All the best,


#4

No problem, charliefik, I am glad that I could help :slight_smile:


#5

Just for anyone reading this the exercise using the relative elements was really fun and gave me a better understanding of the selectors (I think)

Having an app that deliberately changes the position of the fields you want to place data into is great so you can see what differences there are in the selector for the same field if it is in a different position, however if you didn’t have this test app and were using a real world app where you didn’t have 2 different versions of the same field selector how then would you know which fields were essential and which weren’t, is it just a question of randomly removing elements and attributes and seeing if the field is still valid?


#6

Hi @charliefik ,
here you can find a bit more about selector attributes and how to use wildcards:


What may be useful sometimes is the Selector Editor, which “enables you to automatically generate a selector with wildcards, by using the Attach to Live Element image alt text button.” More about it can be found on https://studio.uipath.com/docs/selectors-with-wildcards
Hope this helps.


#7

Thanks @PAD


#8

NP. Happy automation
:blush: