0

Is there any way to get a web element event (javascript) and wait for the script to finish? I'm having a lot of issues with this events because it affects other web elements when I'm filling forms. I don't want to make a staleness_of web element or make an implicitly_wait. I just want to get the event like Selenium gets a webelement and then wait until the script has finished.

  • For me time.sleep() was the most reliable way – sureshvv Oct 20 '15 at 18:39
  • Have you tried [explicit waits](https://selenium-python.readthedocs.org/waits.html#explicit-waits) with and expected condition? – Maikflow Oct 20 '15 at 18:41
  • Can't you use one of [this](http://selenium-python.readthedocs.org/api.html#module-selenium.webdriver.support.expected_conditions) methods for each of the behaviors expected from the "affected web elements"? – jlnabais Oct 20 '15 at 18:44
  • You can also use take a look at `execute_script` [here](http://stackoverflow.com/questions/5585343/getting-the-return-value-of-javascript-code-in-selenium/5585345#5585345) and/or [here](http://stackoverflow.com/questions/7794087/running-javascript-in-selenium-using-python). – jlnabais Oct 20 '15 at 18:46
  • Welcome to Stack Overflow! What have you tried and what was the result? As you did in school... please show your work. :) It's part of the process of getting questions answered on SO. It's helpful to you because it forces you to investigate your own problem and think it through. It also proves to readers that you did your homework and made a reasonable attempt to answer your own question. Thirdly, it helps readers find and diagnose the problem resulting in a better answer for you and less time wasted for us. – JeffC Oct 20 '15 at 20:31

0 Answers0