Selector ID on a form

Hi.

I’m having a problem when OpenRPA gives the IDs for a form in a windows app.

In this case, both LAST NAME field in the upper side of the image, has the same ID for the CDT code in the lower side.

The robot is running going through a file, saves some record, moves to the next line. But it often stops because it can’t find the field with the right ID.

Is there any way to force/give diferent IDs when open rpa looks up the fields?

It still happens when I delete the window information in the selector window (can’t look it up because it is running).
Is there any way to make this more stable? because it just skips the field randomly.

You can try disabling short selectors under Settings → Recorder Plugins → Windows. This will force OpenRPA to traverse the entire UI tree in the selector, and avoid it finding elements with overlapping names. If this is not enough (if you have multiple UI elements on the same “level” that are not unique), you can use the “hidden” selector property called indexinparent. You can read about it here and in other forum posts.

I’ll also recommend you watch this video that explains a little more about how selectors work in OpenRPA.

1 Like

This is a common problem in RPA development. You will always encounter situations, where multiple things will have the same ID and Names. Your job is now to find a way to build the selectors in a way that can identify the correct item.

There is many ways you can try to achieve this. First thing i would try is seeing if those two items have different parents and include them into the Selector chain.

Otherwise you might want to see if they are 100% of the time found in a certain order and select both and just use the first or second found item.

And so on, time to get creative :wink:

2 Likes

Thank you, Allan.

I did watch that video to get info about selectors, and I try to read here in this forum before asking, but the issue remains. I applied the change in the settings, and now it’s more unstable than ever.

So, the thing is, Open RPA was running fine, sometimes “forgot” the selector mid execution and started passing non completed files as exceptions because it was missing that field. That’s no problem, I could reprocess that.

But sometimes the app that was being automated crashed (this is something that is out of our hands), and I had to restart the app and then sometimes, like 1 every 5 times, re apply a new selector for a field. But Open RPA ran steady, usually 30 minutes or an hour at a time, until the other app went down.

After this change, now Open RPA is the one crashing constantly, like every 5 or 10 minutes. And even if I save the project, I pretty much have to set up the selector for that particular field manually, every time.

I do not have the privileges to make a memory dump to get the log, but will ask for that tomorrow. I don’t know if this change in the settings is related, but it did start after I messed around with that and with the selectors.

I now have done the flow for that field from scratch, both recording and manually, compared the selector, tried to give a more unique pathway so Open RPA can more successfully catch the field, but all of this to no avail.

The idea is that we have to click the dropdown field, and then select an option. Funnily enough, selecting the item inside the dropdown menu always hits, but it doesn’t click the “Description” button until I set it up manually.

This is the code for the selector

[
  {
    "filename": XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
    "processname": "NRx191050019",
    "arguments": "",
    "Selector": "Windows",
    "search_descendants": "False",
    "mouse_over_search": "False"
  },
  {
    "ClassName": "ThunderRT6MDIForm",
    "Name": XXXXXXXXXXXXXXXXXXXXXXXXXXX
    "ControlType": "Window",
    "FrameworkId": "Win32"
  },
  {
    "ClassName": "MDIClient",
    "Name": "Workspace",
    "ControlType": "Pane",
    "AutomationId": "3244",
    "FrameworkId": "Win32"
  },
  {
    "ClassName": "ThunderRT6FormDC",
    "Name": "Scan Drugs",
    "ControlType": "Window",
    "AutomationId": "32768",
    "FrameworkId": "Win32"
  },
  {
    "ClassName": "ThunderRT6PictureBoxDC",
    "ControlType": "Pane",
    "AutomationId": "7",
    "FrameworkId": "Win32"
  },
  {
    "ClassName": "ThunderRT6PictureBoxDC",
    "ControlType": "Pane",
    "AutomationId": "11",
    "FrameworkId": "Win32"
  },
  {
    "ClassName": "ThunderRT6ComboBox",
    "Name": "Description",
    "ControlType": "ComboBox",
    "AutomationId": "12",
    "FrameworkId": "Win32"
  }
]

for contrast, this is the selector for the item inside the dropdown


[
  {
    "filename": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "processname": "NRx191050019",
    "arguments": "",
    "Selector": "Windows",
    "search_descendants": "True",
    "mouse_over_search": "False"
  },
  {
    "ClassName": "ThunderRT6MDIForm",
    "Name": XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
    "ControlType": "Window",
    "FrameworkId": "Win32"
  },
  {
    "Name": "NDC",
    "ControlType": "ListItem",
    "FrameworkId": "Win32"
  }
]

I edited out the name. I tried deleting other stuff and testing, I used indexparent, and removing bits of the other selectors and it still just finds the field just once per execution. It crashes, I have to set it up again.

I’m sorry if this is verbose. I know I should use my imagination and all, but I spent all day trying to figure out this. Any help will be greatly appreciated.

Yes, RPA can be frustrating sometimes.

I need to understand something. Are you saying you need to re-create the selectors every time the application restarts? In that case, you need to copy the selector that stopped working and the new selector that is working, and then remove the thing that changed (this is a common issue, and often it’s the AutomationId).

Now, and you are going to hate this. If the application you have is auto-generating AutomationId every time it restarts, there is a high chance it will be even worse to uniquely locate items inside the application since AutomationId was the one that made it unique.
In that case the best way solution you have, is to disable short selectors to make OpenRPA only look at each stop of the UI tree and then use indexinparent every time there is “overlap” between multiple ui elements ( just do not use indexinparent everywhere, it is very expensive to use )

Also, if you application hangs or crashes a lot, that WILL affect OpenRPA as well, this is due to how Windows Automation work, ( everytime an application hangs, it will create a thread pending the response, And if you have to many of those ( like clicking highlight many times on an app that is hanging ) it WILL crash Windows Automation, and you will need to restart your computer to make it stable again )

2 Likes

Thank you, Allan.

I did check the selector that is failing, to the one I had working before (ie, the one that I shared before), and it’s the same.

Even if I select the new selector, and manually close Open RPA, open it again, while the same application window is onscreen, and it doesn’t work anymore.

I’m working on a virtual machine, I will ask for it to be rebooted. And keep posting if anything changes.

oh, could be caching then

Go to settings → Recorder plugins → Windows and disable caching
image

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.