Skip to main content

Targeting Methods in UiPath RPA

What's Target?

A target refers to a specific UI element that we want to interact with. It could be any component on the user interface, like a button, textbox, or dropdown list.

For example, if we have a login form, the "Submit" button and the "Username" and "Password" textboxes would be considered targets.

To ensure accurate identification of targets, we can use an anchor.

An anchor is an additional UI element that helps in identifying the target. Anchors are particularly useful when potential conflicts are detected in the selection window. By incorporating multiple anchors, we enhance the reliability and accuracy of our automation.

When working with modern UI automation activities, an anchor is automatically selected for you. However, you can also manually configure the anchor selection if needed. It's important to note that you can add up to three anchors to a single target, maximizing the reliability of your automation.

Targeting methods help identify the correct target element. Modern UI Automation activities use multiple targeting methods to identify the UI Element you want the process to interact with.

The key targeting methods are:

  • Strict Selectors
  • Fuzzy Selectors
  • Image

Strict Selectors use XML fragments to identify user interface elements based on their attributes. They require an exact match to the address and attributes of the element, providing precise targeting. 


Fuzzy Selectors enable the identification of elements based on patterns or partial matches, allowing for more flexibility. They validate selectors using multiple attributes, accommodating changes during the automation process.


Computer Vision enhances targeting: when the driver fails to 'see' some UI elements, Computer Vision can enable the UI automation. So, it increases reliability and resilience to change in UI-based automations and it is a powerful fallback for the other targeting methods.
Image Selection method reads the array of pixels in a visible region of the application window to identify if it matches the target array. It's useful when other targeting methods can't be applied or in virtual machine environments.

Window selector targets the entire window or application rather than specific windows within it. It's used when automating UI interactions at the application level. The Window Selector option is available in the "Use Application or Browser" activity when the "Window Attach Mode" property isn't set to "Single window."

Unified Targeting Method

The Unified Target method, a modern solution for UI automation, simplifies the interaction with user interfaces by incorporating various technologies and methods like Selectors, Fuzzy Selectors, and Images to identify UI elements.

By using a unified targeting method, the different methods within it complement and support each other, enhancing the reliability of UI automation. This means that even if one method encounters difficulties in selecting a UI element, other methods can step in to overcome the obstacle.

Key advantages of using the Unified Target method

One of the key advantages of using the Unified Targeting method is its versatility and ease of use. It provides a ready-to-use solution that seamlessly integrates into workflows without the need for complex configuration or considering individual method-specific details. This makes it highly convenient and efficient for developers and automation engineers.  

To identify UI elements, the Unified Targeting method uses a combination of UI frameworks.

By default, a proprietary framework is used, but alternative options like AA (Active Accessibility) and UIA (Microsoft UI Automation) are available based on the target application's type.

A Unified Target consists of at least one target, along with optional anchors.

Each UI element is located using a stack of targeting methods, including Strict Selectors, Fuzzy Selectors, and Images.

These targeting methods work redundantly, simultaneously attempting to identify the target element. The first method that successfully finds the target is considered.

To customize the targeting methods used in the Unified Targeting method, you can access the project settings within the UI Automation Modern section. From there, you can configure and adjust the specific targeting methods according to your needs and preferences.

Different sections within the project settings cater to specific types of target applications, allowing for easy configuration.

Now, let's introduce the concept of a Descriptor.

To understand Descriptors, let's consider a practical example of a Type Into activity for the "Cash In" input field. In this case, we want to enter data into the "Cash In" field, which has a corresponding label.

In this scenario, we have an input field labeled "Cash In" where we want to enter data. Additionally, we have an anchor associated with the corresponding label.

The Target here's the input field, and the Anchor is the label.

During runtime, the robot uses three targeting methods, namely Strict Selector, Fuzzy Selector, and Image, to identify the Target (Cash In input field) and the Anchor (Cash In label).

This means there are three targeting methods available to identify the Target and Anchor, resulting in a total of nine possible combinations (3 x 3) of 'Target - Anchor' pairs.

The Target and Anchor pair is known as Descriptor.

Under the hood, the robot generates these nine unique combinations, which are known as Descriptors. Each Descriptor represents a unique combination of the identified Target and Anchor elements using their respective targeting methods.


Generating these Descriptors, the robot establishes a connection between the input field and its associated label.

The robot runs all nine combinations simultaneously, searching for a successful pair without being limited to any specific targeting method. When a matching pair is found, the robot executes the Type Into activity, allowing us to enter the desired input to the "Cash In" field.

The Unified Targeting method employs multiple targeting methods, including Selector, Fuzzy Selector, and Image, to identify and locate UI elements. These methods work in parallel to search for target and anchor elements. The method that successfully identifies the element first is used to create the Descriptor used to identify the UI element.
A descriptor is a unique pair consisting of an anchor element and a target element. It's generated when both the anchor and target are successfully identified using their respective targeting methods.  


Source: UiPath Academy

Comments

Popular posts from this blog

How to set Profile Attribute in Siebel Workflow

For setting the Profile Attribute in Siebel Workflow, follow below steps: Add Business Service box in workflow. Open Business Service properties. Set  SessionAccessService in Business Service Name. Set  SetProfileAttr in Method Name. Then click on Business Service and set Input Arguments as below: Against Name argument you will add your profile attribute name and against Value argument you will add value for the new profile attribute, it could be from Process Property or Literal.

How to call Popup Applet through Server Script in Siebel

Background: Based on the requirements you need to show data or reports on a popup applet. You can invoke popup applet using workflow (below business service will be used in business service step), applet server script or browser script and using vanilla method and setting field user properties. Procedure: Below is the script for calling popup applet through server script: if (MethodName == "MethodName") { var oServiceAF = TheApplication().GetService("SLM Save List Service"); var inputPropAF = TheApplication().NewPropertySet(); var outputPropAF = TheApplication().NewPropertySet(); inputPropAF.SetProperty("Applet Name","ABC Popup Applet"); inputPropAF.SetProperty("Applet Mode","6"); inputPropAF.SetProperty("Applet Height", "700"); inputPropAF.SetProperty("Applet Width", "700"); oServiceAF.InvokeMethod("LoadPopupApplet", inputPropAF, outputPropAF) return (CancelOperati...

How to create and publish Inbound Web Service in Siebel based on Workflow

Inbound Web Services: The Inbound Web Service allows an external system to call a Siebel published Web Service. You can publish a business service or a business process as a Web Service and generate a Web Service Definition Language (WSDL) file that an external system can import. The Inbound Web Services can only be published from Siebel C using SOAP-RPC binding. Source: Oracle Docs What Is The Difference Between Web Services and APIs? An API is an interface that allows you to build on the data and functionality of another application, while a web service is a network-based resource that fulfills a specific task. Yes, there’s overlap between the two: all web services are APIs, but not all APIs are web services. Both web services and APIs are — at their core — very useful and very much used today. However, it’s the web services associated with SOAP and/or Service Oriented Architecture which are falling out of favor. Source: NordicApis Process: Prepare the workflow which will serve as Si...