Hi !
I’ve been trying to understand and have a better use of the mentioned keyword, and wonder if there are some hints or info on the way it works.
Idea is that I run in debug mode the test, which fails on a non found button. I get the error (copy it I mean), and put it in the keyword :
Run Keyword And Expect Error copiedError Click Element mybutton
It took care of setting all the message, get the punctuation etc… But when running it fails however in a wrong way as the error is not as expected.
I copy then the actual ‘aaa’ message in ‘Expected xxx but got aaa’, replace it but it doesn’t work better.
Finally I’m using this :
Run Keyword And Expect Error REGEXP:Element with locator '.*mybutton.*' not found.* Click Element mybutton
Of course this is more flexible and would avoid maintenance if the my button full xpath evolves, but I’m really eager to understand the behavior.
Been looking in Built-in.py from lines 2230, but did not found my answer.
Regards
Charlie