What is the best approach to find element(selector)?is it best practice to put anchor each element?cannyou suggest me?
Hii @hm00776818
The choice of the best approach and best practices
You can use HTML Structure,Class selectors and CSS selectors.
Cheers…!
@Dilli_Reddy is it any disadantage of use selector for every element?
is it a reliable solution to use put anchor for everyelement?
yes… That way is Best Approach to find element
Not sure UiPath doesn suggest always use the anchor if we didnt find best selector suppose you can go to the anchor
Here’s a one-liner that summarizes the best approach:
Use a combination of reliable attributes that uniquely identify the element in the selector.
you can use attributes like id, name, class, or any other attribute that uniquely identifies the element you want to interact with. Avoid using attributes that are subject to change frequently.
it’s a good practice to make selectors more robust by using wildcard characters like “*” and “?” where appropriate to handle dynamic attribute values.
cheers…!
Let me try to make it little elaborative so that it would helpful for others in future
The best approach to find an element in UiPath is to use a selector that is as specific as possible. This will help to ensure that the robot can always find the element, even if the user interface changes.
There are a number of different ways to create a selector. One way is to use the UiPath Recorder. The Recorder will automatically generate a selector for the element that you click on.
Another way to create a selector is to use the UiPath UiExplorer. The UiExplorer allows you to inspect the user interface and select the element that you want to automate.
When creating a selector, it is important to use the following best practices:
- Use unique identifiers, such as the element’s name, ID, or class.
- Avoid using relative positioning, such as top, left, width, and height.
- Use wildcards (*) to match any value.
If you are still having trouble finding an element, you can try using the following techniques:
- Use the UiPath Selector Editor to modify the selector.
- Use the UiPath Debugger to step through your workflow and see how the selector is being evaluated.
- Use the UiPath Community Forum to ask for help from other UiPath users.
Anchors
An anchor is a special type of selector that can be used to find an element relative to another element. Anchors can be useful for finding elements that are dynamic or that change frequently.
To create an anchor, you need to first select the element that you want to use as the anchor. Then, you need to click on the “Anchor” button in the UiExplorer.
Anchors can be very useful for automating complex user interfaces. However, it is important to use them with caution, as they can make your workflow more difficult to maintain.
Which approach is best for you?
The best approach to finding an element in UiPath depends on the specific element that you are trying to find and the complexity of the user interface.
If you are trying to find a simple element, such as a button or a text box, then you can use the UiPath Recorder to generate a selector for you.
If you are trying to find a more complex element, or if the element is dynamic or changes frequently, then you may need to use the UiPath UiExplorer to create a selector. You may also need to use anchors to find the element relative to another element.
Check this document to know more on the best approach
Hope this helps
Cheers @hm00776818
Generally this is the preferred way
Strict selector>fuzzy selector>anchor base>cv activities>image>cordinates
This order is mostly because it is always better to use strict because that way you can identify a single element quickly
Then if you have a changing element but part of it si constant then fuzzy helps
If you need a sepecific element only but is jot very reliable then anchor base works
If non of the above works we have cv related activites
If cv also fails last options are image and cordinates which are least preferred as they change even with a slightest change on the system
Cheers
Hope it’s clarified
If yes would recommend to close this topic
If not we can this discussion open
Cheers @hm00776818