We have quite a bunch of Robot Framework tests for our application. We experience random occurrences of failed tests. One of the scenario’s that occurs is that a pop-up is displayed in an overlay with a message that a general exception has occurred. There is a button on this pop-up to display the details.
What I would like to do is that I can start a keyword when a test fails because of a time-out. Because when this happens, I would like to be able to search for the modal pop-up and if it is available, I would like to expand the details and take a screenshot.
Would something like this be possible? Preferably without changing all the tests that we have but instead have this as a suite event or something like that.
Thanks in advance.
Björn
P.S. In addition I would like to have insights in the console logs, but as I read in some other threads this is a challenge on its own…
I have been looking into the documentation for these keywords, but as I interpreted it, it is about browser alerts (like javascript alerts). In our situation it is an overlay Angular component which prevents links etc. from being visible / enabled.
One question though, can you reproduce this dialogue manually?
The reason I ask is so you can check if the dialogue is actually a browser dialogue or a popup element in the html page (see if you can inspect it’s elements with dev tools).
If its a browser dialogue those keywords I mentioned are the only ones that can interact with it, if it’s in the html then they won’t help and you’ll need the standard Click, etc Keywords.
In our scenario the pop-up is a model overlay in the HTML, so not a dialog from the browser. We will be able to handle this using the ‘Register Keyword To Run On Failure’ keyword.
Interesting, it worked for me when I clicked it this morning.
Maybe it’s a new keyword and you need to refresh your browser cache for the Browser Library? (this is a guess) when I go to the top of the documentation the Library version is 16.0.0.
What makes me think it might be a new keyword is I actually picked up the link from this thread: Comments for Get Console Log
You were spot on with your suggestion to refresh browser cache. I will use this in combination with ‘Register keyword to run on failure’ to try to get additional info when when our tests run into a problem situation.