I have a Webdriver instance and I want to wait for an element to be clickable while also checking for certain event to be raised from another thread and if it is raised, another element of that same Webdriver will be used/interacted. What I thought of is to create another thread that will wait for the event to be raised and then will interact with the another element but as I know Webdriver isn't thread-safe so it may yield unexpected results. What should I do?
Asked
Active
Viewed 52 times
1
-
Sharing your code would be helpful! – Kamalesh S Nov 13 '21 at 14:45
-
I found a solution for it. I don't know if it's the best way but it works. Instead of waiting with a WebdriverWait instance that blocks the current thread I wrote a while true loop that calls find_element_by_xpath() infinitely until an element not interactable exception is **not** raised. inside the while loop I also wrote the code for the interaction of the other element. – ItsMoi Nov 14 '21 at 16:58