$show=home$hide=mobile-page

Dynamic or Variable Selectors in UiPath

Dynamic or Variable Selector in UiPath. Tutorial on how to use dynamic selectors in UiPath. Explains how to use variables in UiPath selectors.

Dynamic or Variable Selector in UiPath. Tutorial on how to use dynamic selectors in UiPath. Explains how to use variables in UiPath selectors.

Tutorial on how to use dynamic selectors in UiPath. Explains how to use variables in UiPath selectors.

In this post, we would discuss about how to use dynamic or parameterized selectors in UiPath.

To explain parametrized selectors, we would use Automation Challenge Round 1 in the website http://www.rpachallenge.com/ by UiPath.

The challenge is to create a workflow that can enter data to the form and submit. We have around seven fields in the webpage and they all change their properties on each refresh. As you might already know, we can achieve this by indicating an anchor for each of these fields.

So, I need to capture all the fields and its anchor and then design the workflow to enter details in all those fields.

Let us capture the field First Name. The selector would look something like below.

<html app='chrome.exe' title='Automation Challenge' />
<webctrl aaname='First Name' tag='LABEL' />
<nav up='1' />
<webctrl tag='INPUT' />

To identify the First Name text box, I used the anchor with aaname First Name.

Now let us capture another element, say Email. The selector for email would look like below.

<html app='chrome.exe' title='Automation Challenge' />
<webctrl aaname='Email' tag='LABEL' />
<nav up='1' />
<webctrl tag='INPUT' />

If we compare the selectors, only change is the aaname. So if we parametrize aaname, we can identify any element.

To do this let us declare a variable fieldLabel.

Now we have to use the variable fieldLabel inside the selector. We can do it like below.

"<html app="" chrome.exe"" title="" Automation Challenge"" /><webctrl aaname=""" + fieldLabel + """ tag="" LABEL"" /><nav up="" 1"" /><webctrl tag="" INPUT"" />"

See how we have introduced the variable fieldLabel in the selector. The entire string is in a single line and double quotes are escaped. The correct way to escape double-quotes in VB is by doubling the double-quotes.

To use this parametrized selector, we need to enter the string into the Selector field under Target (Input >> Target >> Selector). Entering value in the selector pop up window does not work.

You can also save the string to a variable and use that variable as the selector.

Now that we have a variable selector, you can enter value in any field by changing the variable fieldLabel.

A sample workflow is attached below. Follow the steps below to make the workflow work or you can modify it.

  • Open http://www.rpachallenge.com/ on Chrome browser.
  • Navigate to the first challenge by clicking start.
  • Make the window active.
  • Run the workflow from UiPath.

Download Sample Project

COMMENTS





Name

AngularJS,3,Automation Testing,8,Blue Prism,1,CSharp,5,Disqus,1,Excel,3,Excel Addin,1,HP ALM,5,HTML5,1,ISTQB,2,Java Script,2,Manual Testing,7,Photography,1,Quiz,2,REST API,5,Robotic Process Automation,2,RPA,2,Testing,15,UFT,8,UiPath,1,VB,5,VBScript,1,VSTO,1,Wordpress,1,
ltr
item
Aneejian: Dynamic or Variable Selectors in UiPath
Dynamic or Variable Selectors in UiPath
Dynamic or Variable Selector in UiPath. Tutorial on how to use dynamic selectors in UiPath. Explains how to use variables in UiPath selectors.
Aneejian
https://www.aneejian.com/2019/05/dynamic-or-variable-selectors-in-uipath.html
https://www.aneejian.com/
https://www.aneejian.com/
https://www.aneejian.com/2019/05/dynamic-or-variable-selectors-in-uipath.html
true
5798203121010168414
UTF-8
Loaded All Posts No posts found VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU ARCHIVE SEARCH ALL POSTS No post found which matches with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy