Hello Everyone,
I am facing a rare kind of issue while Automating through Selenium/Python while filling out two fields on a website. My script fills out the first field i.e. ORIGIN CITY pretty fine. I have induced WebDriverWait for the second field DELIVERY ADDRESS. My guess the DELIVERY ADDRESS field is pretty much clickable even before the waiter is induced.
But the ORIGIN CITY field have a JavaScript associated through onchange event as follows :
onchange="javascript:setTimeout('__doPostBack(\'DrpCity\',\'\')', 0)"
Once the JavaScript finishes it clears up the text from the DELIVERY ADDRESS field.
I did had a look at the Java Client's ExpectedConditions as jsReturnsValue which is not there for the Python client.
Any suggestions please?
My Code :
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Firefox()
mySelect = Select(driver.find_element_by_id("DrpCity"))
mySelect.select_by_visible_text("Pune")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,"//input[@id='txtPickUp']"))).send_keys("XYZ")
Thanks and Regards
Debanjan-B