Using Python bindings, Selenium WebDriver click() is not working sometimes.

后端 未结 7 1467
旧巷少年郎
旧巷少年郎 2021-02-02 12:27

I am trying to submit an input(type= button).But I am unable to update the value. Any help is appreciated. I have attached the testcase below for your reference.

相关标签:
7条回答
  • 2021-02-02 13:18

    In case this is still a recurring problem for anyone else, if you have confirmed your code is correct (you've reviewed it for errors etc.) and you still find the find_element_by_...('text').click() function not working properly it is often due to your code continuing to run before the JavaScript can update the page.

    A simple solution is to import time then insert the below code immediately after any click() methods:

    time.sleep(2) 
    

    The duration of the sleep timer can be whatever you choose. In my case I used 2 seconds. Hopefully that helps.

    0 讨论(0)
提交回复
热议问题