I am using Robot Framework to do test automation and would like to know if there is a way for me to extend the Selenium Webdriver to handle a loading element universally. For reference when I say loading element I am referring to a custom Angular element.
I understand that I can do a Wait Until Element Not Visible
, but what I really want to do is create a constant listener on the Selenium Webdriver to halt whenever this loading element is visible. I would like to not constantly use a robot keyword to check if the element is visible, and be forced to implement arbitrary-ish sleeps.
If my question is still not clear, below is some pseudocode / psuedoflow I was thinking of. I'm assuming Selenium is single threaded, otherwise this idea would be fruitless.
Selenium Webdriver:
AddListener(new LoadingListener)
LoadingListener
While ( LoadingElement is Visible)
Sleep 1s
Please respond with any feedback. If this isn't possible let me know, If you have any ideas also let me know.