Thanks for that suggestion!
Hey good news, I think it is working now (except for the last Currency Type field, but hopefully that is a one-off issue that I can figure out). When I changed the Click activity to SendWindowsMessages, it worked beautifully!
Thanks for all your help, I appreciate it.
Sorry, I may have marked this as “complete” prematurely. It worked correctly one time, but then afterwards it reverted to its original behavior.
Did you change your TypeInto activities’ options too?
No, those I had to leave as-is. Otherwise, it wouldn’t type anything.
Could you type someting into a field and select it with the UI Explorer and share the Visual Tree, please?
Can you please dig into the Company’s TD to see all its descendants?
EDIT: It might also be interesting to do that, interact with the ui then come back to the UI Explorer and see if any change was applied.
Regarding your edit, interestingly when I highlight the child element, the red rectangle covers only the input value within the field, rather than covering the entire field.
When I click on the field, notice that on the left is the actual value that is input, and on the right is a small square icon (which can be used for lookups).
The following selector logic seems to work as far as highlighting only the text within the cell rather than the entire cell:
I will try rewriting my code to target those children instead and let you know how it goes.
Ok, it was a good idea, but sadly it is behaving the same as before.
I won’t let you down. See you tomorow (UiPath complains I “talk” too much)
Understood … thanks so much for your help thus far.
I just tried quickly retrofitting my code to work in Internet Explorer instead of Firefox. This time, I saw the yellow highlight rectangle appear 5 cells above the grid, then 4 cells above, 3, 2, 1, and then the remaining values were actually written into the grid, but all of them shifted by 5 cells upwards (i.e. see screenshot below). It’s as though the coordinate system is shifted vertically by 5 cells.
I am going to try with Chrome now and see what happens.
Ok, I tried the same with Chrome, and no luck there either.
So I decided to try something new, namely, to tab through each of the fields and to interrogate each one (i.e. using the GetAttribute activity) to identify its rowName and then paste the corresponding text (using CTRL-v) accordingly.
Sadly, this approach also fails, for the same reason as before. Namely, I cannot guarantee where it will start. If I command it to click on tableRow=‘1’, for example, it may actually click on tableRow=‘2’ instead of 1. And sadly, according to my research, there is no way in UIPath to detect (or confirm) the element that you are on.
Hence, I am unable to use the tab-through approach because there is no way to confirm which element I’ve started on. (And unfortunately, there is no way to tab into the table; you have to click on an element to begin).
I also tried fiddling with screen resolutions per this post (Chrome error: Fields are moved when selecting), but to no avail.
Here is a recap of the problem and what has been tried so far.
The bot is not clicking on and typing into the correct elements. The results are somewhat random; it will usually click somewhere close to the actual element, and sometimes it will get the first 1 or 2 elements right, but then it often clobbers previously-visited elements. (e.g. It might fill in AccountingPeriod and Ledger correctly, but then clobber Ledger with Company, Account, Cost Center, etc.). Although random, there is somewhat of a pattern in that all of the clicks tend to be bunched together near the top, and also tend to be in the correct order sequentially from top to bottom (most of the time).
The problem appears to be in the clicking, not in the Selector. I tried the following approaches and all had similar behavior:
- Type Into
- Relative Reference
- Anchor Base (though I couldn’t get it to work on this page)
- Click Image (where the image is a rectangle containing both the label on the left and its corresponding text field on the right). By the way, this was the only scenario where it sometimes mixed up the sequence, e.g. swapping AccountingPeriod with Ledger).
(By the way, I owe a huge thank-you to @msan for taking the time to work with me and try out these different scenarios.)
In each case, it correctly selected the field, but then failed to click on it reliably. The selectors were well-vetted; able to highlight the element correctly, and contained no volatile tags (e.g. no ID’s, always aaname’s, etc.), and no error messages. Moreover, the ‘Click Image’ also fails to click properly and selectors do not even come into play. So I feel the problem is definitely not the Selector. It is the click itself.
I also tried all 3 supported browsers (i.e. Fire Fox, IE, and Chrome), all 4 supported laptop display settings (i.e. 100%, 125%, 150% (recommended) and 175%), and with various different monitor configurations.
Also note that I am able to tab through the various fields in the grid reliably. The problem is that I cannot tab into the grid; I have to click on one of the elements in the grid at least once just to enter the grid, and there is no reliable way to click on, say, the first element in the grid and have it go there (i.e. it sometimes goes to the second element instead). Moreover, according to my research, there is no way to detect what element I’ve clicked on, once I’m in the grid.
Any guidance or advice on what to try next would be most welcome.
Ok, I think I have a workable solution. It is a bit kludgy, but I can live with it.
- To click on the top element of the grid, I will use a Click activity with the CursorPosition set to Position=TopLeft and OffsetX, OffsetY values set as a parameter.
- I will then use the tab key to visit the remaining elements in the grid.
- I will use an integer variable to keep track of which row I’m on, and use that to interrogate its label on the left.
By the way, just a note about the starting CursorPosition (first bullet). To figure out the coordinates, I first tried to Click with F3 to see what coordinates were captured in the Click activity. But that didn’t work straight away; the coordinates were off a bit, so I had to tinker with them. (This is consistent with the other clicking problems that I mentioned earlier in this post.)
Unless anyone has a better idea, I think I’m going with this work-around.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.