Modern Activities related question

Hi All,

I have some question in the modern activities as below:

When we are working on modern activities (web automation), which selectors should we need to keep, and which one is most reliable??
1.Strict selector
2. fuzzy selector
3. image
4. OCR

please let me know at what time what selectors we need to use.

Thanks in advance

Hi @naveen.s

Strict Selector is Used for stable, structured pages with unique elements.
Fuzzy Selector is Used for dynamic pages or elements with similar attributes.
Image is Used for non-HTML content or inaccessible elements.
OCR is Used for text-heavy elements or when text is the only identifier.

Hope it helps!!

@naveen.s,

When working with modern activities for web automation, it’s important to understand the different types of selectors and their use cases. Each type has its own strengths and ideal usage scenarios. Here’s a breakdown of when to use each selector:

1. Strict Selector

Description:

  • A strict selector precisely defines the elements it targets on the UI.
  • It includes exact attributes and values to identify elements.

When to Use:

  • Use strict selectors when the structure of the web page is stable and unlikely to change.
  • Ideal for scenarios where the element’s attributes (such as ID, class, tag) are unique and consistent.
  • Provides the most reliable and fastest performance as it directly targets the element.

Pros:

  • High reliability when the UI is stable.
  • Fast element identification.

Cons:

  • Can break easily if the UI changes (e.g., new attributes, element repositioning).

2. Fuzzy Selector

Description:

  • A fuzzy selector allows for some variability in the attributes it uses to identify elements.
  • It can tolerate minor changes in the web page’s structure.

When to Use:

  • Use fuzzy selectors when the web page structure might change slightly but the element of interest remains relatively identifiable.
  • Good for elements that might have dynamic attributes or slight changes in their positioning.

Pros:

  • More resilient to minor changes in the web UI.
  • Useful for handling dynamic content.

Cons:

  • Slightly less reliable than strict selectors.
  • Can be slower due to the broader search criteria.

3. Image

Description:

  • Uses image recognition to identify UI elements based on their visual appearance.
  • Does not rely on underlying HTML attributes.

When to Use:

  • Use image selectors when dealing with elements that cannot be easily identified by attributes, or in environments where HTML selectors are not accessible (e.g., Citrix, virtual environments).
  • Useful for applications with custom graphics or non-standard UI components.

Pros:

  • Can interact with any visible element regardless of underlying technology.
  • Useful for complex UIs where selectors are not reliable.

Cons:

  • Can be less reliable due to changes in resolution, scaling, or visual changes.
  • Slower than attribute-based selectors.
  • Prone to errors in case of slight visual changes.

4. OCR (Optical Character Recognition)

Description:

  • Uses OCR technology to read text from the screen and identify elements based on the text content.

When to Use:

  • Use OCR selectors when dealing with text-based elements that cannot be easily selected through HTML attributes or image recognition.
  • Useful in environments where text content is the primary identifier, such as in scanned documents or images with embedded text.

Pros:

  • Can identify elements based on visible text regardless of underlying technology.
  • Useful for text-heavy UIs or documents.

Cons:

  • Can be less accurate, especially with complex fonts or poor image quality.
  • Slower due to the OCR processing time.

Summary of Usage:

  • Strict Selector: Use when the web page is stable and attributes are reliable and unique.
  • Fuzzy Selector: Use when the web page might have slight changes or dynamic content.
  • Image: Use for non-standard UI components or in environments where HTML selectors are not accessible.
  • OCR: Use for text-based elements in non-standard environments, scanned documents, or images with embedded text.

Choosing the right selector depends on the specific requirements and stability of the web page you are automating. In many cases, a combination of selectors might be necessary to achieve optimal results.

LLM helped me to write this but it’s validated by me.

Thanks,
Ashok :slight_smile:

It depends on your needs, on what you’re automating in.

Strict and Fuzzy are the most commonly used for normal situations. Strict vs Fuzzy really depends on the application you’re automation in, for example in Salesforce I find Fuzzy to work better in general, but there are still some UI elements where I use Strict.

Image selectors replace the “Click Image” etc activities. Image also works as a good backup to Strict/Fuzzy for things like buttons. Computer Vision is for automation where you can’t get normal selectors, like Citrix or RDP windows.

It’s not an either/or. You can use more than one of them in an activity and UiPath will execute all of them until it finds the UI element.

1 Like

By the way, it’s important to pay attention to what the indicate window is telling you. If you have multiple selector types checked, it will tell you which one was the first to find the UI element. It puts a little bullseye icon next to it.

1 Like

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