we are currently using Robot framework version 5.0.1 (Python 3.11) to implement end-to-end tests.
When the system under test (SUT) is launched, we have to login and there is always a confirmation popup which appears (windows security, CryptoAPI).
In the registry I have already added that the certificates are selected automatically but the popup is still coming (see the image below),
and I wanted to know if we can automate the click to accept or make sure that the popup does not appear.
Please let me know if you have any solutions
Welcome to the painful world of windows security…
Unfortunately these security dialogues have a habit of running under the system user context while automation tools are running under your logged in user’s context so the automation tool can not “see” the dialogue at all, this is not unique to robot framework.
I’ll start with a little rant:
This sounds like a defect and a problem for the developer to solve, hopefully you’ve raised a high severity defect for this?
Now for some work around ideas:
- I’ll suggest you try the following to see if it’s in user or system context.
- try to get robot framework to take a screenshot of this dialogue
- try getting your robot script to wait for the dialogue and then send ENTER key or SPACE key since the button you want to click is the default.
- when the dialogue is open press the Alt key on your keyboard (or what ever is the equivalent key in your keyboard’s language), this should show an underline under 1 letter for each button, ATL+this letter should be the shortcut keystroke for clicking that button, try getting robot to sent that keystroke
- If none of that worked then it’s probably in system context and no automation tool is going to be able to interact with the dialogue, so the best you can do is pause the script to let a tester manually clear the security dialogue. There is the Dialogs Library built into for this purpose, I’ll suggest you use
Execute Manual Step this will pop another dialog with the text you specify in
message (instructions to clear the security dialogue) and pass fail buttons for the tester to click. Obviously this is just a workaround until developers fix the defect.
Hopefully something here is helpful,