Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

The given key was not present in the dictionary

Hello All,

I have a problem with exception  "The given key was not present in the dictionary."

Unfortunately, the problem is not easy to reproduce.

Here are some of the things that have been observed:

- the problem was exacerbated when I made copies of the process (Save as new process)

- it doesn't help to "catch" a new image

- the problem occurs in every place where the image is used (e.g. IF image, Move Mouse to Image)

- a workaround is to add a problematic piece of code to the library (unfortunately I have a lot of such places in the code)


Did any of you have a similar problem and solve it?

 

After reinstallation of the solobots the problem disappeared for 2 months and now it is happening again (reinstallation of the solobots will not help)

My version of Process Robot: 2018.1.3.3043



Best Answer

Joseph,

Thank you. I was able to solve this problem that wasn't so obvious.

I used the get window and focus to make sure I had an RDP window.


Try upgrade your process robot to the latest version  version 2020.


I know this is one of the solutions. Unfortunately, I don't have the possibility of updating at the moment.

Lukasz, The only time I have encountered the key not in dictionary error on move image and if image ... is when your image is in an RDP session . window and you execute the if image or move image, when the rdp window is no longer opened. Is this your situation too? If this is your situation test that rdp session window is opened ( by title), before issuing any image actions against it.

Joseph, thank you for the idea. :)

The robot works on an application that is open via RDP. :)

I'll add an additional check.

Answer

Joseph,

Thank you. I was able to solve this problem that wasn't so obvious.

I used the get window and focus to make sure I had an RDP window.

Lukasz,

Glad it worked ! 
Yep, It took a long time for me find the cause of this error (of key not present in dictionary of if image and move image)

Alternative approaches:
1)  ... You can also just check that rdp window title with wild character * in title name of an  "If Window is Open action ( of the RDP window title name).

2)  ... If process mstsc.exe  is running    (process name of RDP exe)

Lukasz, In your general error handler - begin exeception block encompassing your process, where in its called exception function you use image actions to close your apps in the rdp window session or image actions to logoff your rdp desktop that you trst that rdp window is open before executing those closing/logoff image actions. Because begin exeception error handler may be invoked for failing action occuring befote your action of connecting to rdp desktop session.
Login or Signup to post a comment