Ayubx
Ayubx

Reputation: 665

Invalid ui node error when indicating in uipath studio

I have started using uipath for the past two days. I am reading from an excel sheet and loading to a web page and progress has been good.

I am stuck on the following scenario. I have a bs-datepicker that is used to enter dates. I have been able to get the date from the data in the sheet, separate the day,month & year parts. I have automated the selection of the month and year I have no issues.

The day is where the issue is. The control looks like the below,

enter image description here

On using the inspect tool on chrome, i see this for the 29th of May,

<td role="gridcell" class="ng-star-inserted" style=""><span bsdatepickerdaydecorator="" class="">29</span></td>

I see the following for 29th of April,

<td role="gridcell" class="ng-star-inserted"><span bsdatepickerdaydecorator="" class="is-other-month">29</span></td>

As you can see one difference between the two is that the span class is an empty string for 29th May which i am guessing is the error when i am getting when attempting to indicate on screen 29th of May,

enter image description here

In fact i get that same error when trying to indicate all elements for the active month, which is May in this case but no errors when indicating for the last month which is April.

Any tips on how i can get around this ?

Thank you

Upvotes: 0

Views: 5730

Answers (4)

Ayubx
Ayubx

Reputation: 665

Thank you everyone for your answers. What i ended up doing is using a try catch with a selector not found exception.

So the following will fall in the try,

<html app='chrome.exe' title='Add Employee | *' />
<webctrl aaname='{{FromDay}}' tag='SPAN' class='' parentclass='ng-star-inserted' />

And in the Catch,

<html app='chrome.exe' title='Add Employee | *' />  
<webctrl  aaname='{{FromDay}}' tag='SPAN' />

Upvotes: 0

ali hwang
ali hwang

Reputation: 64

maybe you can change the node selector in uipath studio from class='is-other-month' to class='*'

Upvotes: 0

q.gio
q.gio

Reputation: 46

you should use Dynamic selector because it seems that the selector changes when you change the month. https://docs.uipath.com/studio/docs/dynamic-selectors

Or another option, you could use the "Click text" activity to click on the number of the month you need.

Upvotes: 1

rrrares
rrrares

Reputation: 9

You can try switching between the UiFrameworks when grabbing your selectors:

Switching between Ui Frameworks

There is a high chance of it working with "Active Accessibility", since it's suited for legacy apps or apps that do not respond to the Default framework. Switch between all 3 to make sure.

If that doesn't work, you can try to grab the selector by navigating to the visual tree and manually going through all the nodes until you find your element.

Upvotes: 1

Related Questions