Invalid ui node error when indicating in uipath studio - uipath

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,
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,
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

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.

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.

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

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' />

Related

UFT is waiting the entire object sync timeout before clicking a webelement

Alright, in my web application there's a dropdown that UFT picks up as a 'WebElement' instead of a 'WebList'. The options available in this dropdown are all just 'divs' and the data within the div is dynamic. Has anyone had to deal with this before? I even tried using the absolute xpath within the object repository, but that seems to be inconsistent. Whenever I run my test the first time it interacts with the dropdown it will wait the entire object sync timeout before selecting the element. Then I have it going back to select another item from the dropdown and it goes instantly. This isn't the approach I want to take with this as the abs xpath could break at any time. I've been reading blog posts etc from as far back as 2008, and tried every person's suggestion but I can't reliably click a dropdown and select something. I can give more detail if needed, but any help here would be appreciated.
When UFT waits the object synchronization timeout and then succeeds to perform the action it's usually because it has been using smart identification. Look in the report to see if this is the case (or just disable smart identification and see what happens).
If this is the case, you should try to fine-tune the description to succeed on the description and not resort to smart identification.
I got it! This behaviour was being caused by the 'browser' being different in that part of my code. I think this happened due to some of the same items being added into the OR from different pages.
Instead of having:
Browser("Browser1").Page("Page1").WebElement("Element I want").
It was:
Browser("Browser2").Page("Page1").WebElement("Element I want").
Once this was corrected in the OR everything worked as expected.

Uipath studio- data scraping error appear after I modified the selector

I use UiPath and data scraping activity. First open the browser direct to the e-commerce site and search the product. Everything is fine, until after the product was searched and results were shown, the data scraping stopped and the output gives the following error message which I couldn't understand why:
This is because I had previously edited the selector. Currently, my selector is:
<html app='chrome.exe' title='Qoo10 - "ItemsFList" Search Results : (Q·Ranking): Items now on sale at qoo10.sg' />
My previous selector did not causes any error and the selector was:
<html app='chrome.exe' title='Qoo10 - cooking oil; Search Results : (Q·Ranking): Items now on sale at qoo10.sg' />
The ItemsFList is actually a String variable I created. This variable stores a list of text in String format. It stores the exact same text as the rpa input into the search box at the e-commerce site when the rpa begins running.
UiPath tries to write as specific a selector as it can based on the data you provide it. Unfortunately, sometimes that selector is too specific.
For example, when you scrape a page, it includes the title of the page in the selector. But the page title will change if you are looping through more than one page. And sometimes the page title is completely dynamic, perhaps including a variable that changes every time the page is loaded. If the title is hard-coded into the selector, your program will only work if that page remains constant, which rarely happens.
Remove the title
You can use wildcards in the title to make this part of the selector more generic. Quite frankly, my experience is that that title is rarely needed at all, so I just remove it whenever I do a UiPath web scrape of HTML pages.
As you can see in the image below, the title is deselected. You can then click the orange ? Validate button to confirm that the page scraping will still work without the title. If everything goes green, you're good to go.
As you've found, the title almost always gets in the way.
The issue is your UI selector. It is clear with your error as you can see the title is dynamic and you're relying on the title to find the browser window or browser control. You have to make your selector more generic and than it should work. Try go through the UI explorer or UIPath Documentation. The few options you can try in your selector is:
Remove title from the selector <html app='chrome.exe' />
Or make Title generic
<html app='chrome.exe' title='Qoo10 - *' />
Note the * sign in the title that will make it more generic and please go through their documentation

How do UIPath selectors work when there is no specific ID

I am trying to create a UIPath project to automate filling out a simple form in Microsoft Dynamics Web Client 2016. I have been running into problems with strange behavior due to what I believe to be unreliable selectors. The Dynamics web client is written with Angular and seems to be a single page application. None of the inputs have any type of ID or specific data-attribute that UIPath can use as a selector as far as I can tell. It looks like the program is using the DOM tree to count the number of nested divs in order to assign each input with a "parentId" attribute. This seems to cause unreliable behavior when there are popup windows and I am worried that going forward with an automation with this particular web application will not be scalable.
Example of a selector:
<html title="Microsoft Dynamics GP" />
<webctrl parentid='a000000000000000056800083584c00030100000000f1550000000000'
tag='INPUT' />
Where are this selector and parentId attribute coming from and will it be reliable and scalable through updates and form changes?
If the element itself can't be found reliably, just work around the issue by using an anchor on an element that can. For example, the input elements on http://www.rpachallenge.com/ can never be found reliably as their id changes every few minutes. So, if you need to type text into the field for "Company Name", we need to work with anchors - in our case there will always be a label with a distinctive text.
You will need to use an Anchor Base along with a Find Element activity (plus the desired action). Here's the selector for the anchor - using the element's descriptive text:
<webctrl aaname='Company Name' tag='LABEL' />
Then, the Type Into activity just refers to an Input element:
<webctrl tag='INPUT' />
The only thing to keep in mind are multiple languages in which case you will need to either consider them in the selector, or select the element by id, if applicable.

Selenium and xpath: Clicking a checkbox in one table's column, based on text in another?

Basically there is a table with names, edit buttons, and a checkbox at the end column that I want to check on with selenium. But I want to make sure I click on the one I created with selenium and that's where my problems begin.
Using the selenium IDE, the names xpath is
//tr[5]/td[2]
The checkbox is
//tr[5]/td[4]/input
So the text is in column 2 and the box is column 4, and my record would be the 5th one. but I cannot for the life of me get ANY text search to work. Even something basic like
<tr>
<td>storeText</td>
<td>//tr[contains(text(), 'McGowan')]/td[2]</td>
<td>text</td>
</tr>
Even if the text matches identically, it gives me the locator not found error. No matter what combination i use to find xpath by text it has never worked, and ive spent quite a few hours reading every combination out there.
We are using the IDE and the RC in html, so no java or any other exporting.
Thank! (My first post!)
//td[text()='McGowan']/../td/input[#type='checkbox']
Let me know if this works for you!
This might be odd, but the coment below the answer, regarding a random click that let to the answer ---> //tr[contains(., 'text')]/td[3]/a <--- was just randomly verified as exactly what I needed.
Good job guys.

Hours labelling for RadChart

I'm trying to use Telerik's RadChart (Spline) on WP7 to display the hourly temperature forecast. I'm having a hard time finding information on how to set the horizontal-axis to group by hour. The examples project contains a chart grouped by month, but when I change
DateTimeComponent="Month" LabelFormat="MMM yyyy"
to:
DateTimeComponent="Hour" LabelFormat="hh ddd"
I get a divide-by-zero error when it tries to build the axis.
Here is an example of what I'm trying to achieve:
NOAA Hourly Weather Forecast Graph
Anyone know of a tutorial or what I might be doing wrong?
Thanks
For the LabelFormat can you please try "h tt"? I don't have access to try right now, but that should work. The format would be "3 PM"
What solved it for me was to switch DateTimeCategoricalAxis to a DateTimeContinuousAxis. I found the examples in the Telerik samples app very helpful.
<telerikChart:DateTimeContinuousAxis
LabelFitMode="MultiLine"
LabelFormat="htt"
MajorStep="6"
LabelStyle="{StaticResource PhoneTextSmallStyle}"
MajorStepUnit="Hour"
PlotMode="OnTicks" />

Resources