Form Input Value automatically resets when executing query with Python Selenium
I am trying to set input field of a Modal Form using Python's Selenium
Here's how the form's input looks like :
<input step="any" class="input" placeholder="0" value="">
I set the input value with this script:
script = "document.querySelector("input.input").value='1'"
driver.execute_script(script)
time.sleep(3)
My script does enter input value in the field but it remains there only for 3 Seconds and that too due time.sleep(3)
, otherwise it resets instantly to 0.
How can I set it to remain there and not to reset?
When I try normally on a HTML page, it does not resets. It does so only on that web page.
Kindly help
from Recent Questions - Stack Overflow https://ift.tt/3AMvVub
https://ift.tt/eA8V8J
Comments
Post a Comment