Selecting One among Identical TextBox / Identfying one among Two Calendar Dates

howto

#1

Query
Am trying to directly type into the dates to the edit box but due to similar properties, UI path throws the exceptions. How do I handle this issue.

Solution

In these scenario you need to automate click Image or Text and provide the offset value relative to the Text where exactly you want to click.
Post that you need to use a Type Into activity to provide values to the TextBox.

For Example : (Web Application)


  1. Use a “ClickImage” activity , to select the Text which identifies the Calendar text box . In this I have identified the Start Date and provided value to the textboxes below .
    In your case you need to fill it in one calendar control.
    image

The offset value provided for the activity : It varies based on the location . You can get this using Web Recording ->Image -> Mouse -> Click
After providing the relative area the offset values will be updated immediately .
image

  1. Use a Type Into Activity to provide the values into the clicked textbox . Screenautomation.zip (161.2 KB)

​https://www.timeanddate.com/date/duration.html?d1=01&m1=09&y1=1993&d2=01&m2=01&y2=1991&
You can execute the workflow , attached in the ticket .
Open the web browser and run the workflow , values will be entered into the related textboxes .

For better understanding please refer the below link :


Hope this is helpful .


#2

@PranayaSahu The other method are

  1. Fine tuning the selector- to have properties from the parent tags. In the example specified above, the parent selector for the calendar fields can be differentiated with the label “Start Date” and “End Date”
  2. Injecting javascript code- As you have specified it as a web application, you can use javascript to manipulate these calendar values. Even though the tags are identical, you can use next, previous, child and other menthods to update the values.
  3. Using Find children activity to retrieve selector for both calendar controls.