From the following picture, I am trying to clear the "Server Address" field, and to input a new value. but somehow, it keeps giving me timeout exception.
here is my general python code. Any alternative ways I may try ?
try:
target = "//label[contains(text(), 'Server address')]/following-sibling::input"
WebDriverWait(self.driver, 30).until(
EC.presence_of_element_located((By.XPATH, target))).clear()
WebDriverWait(self.driver, 30).until(
EC.presence_of_element_located((By.XPATH, target))).send_keys(var)
except Exception as e:
....
Thanks for the help.
Jack
I see that the XPath exists inside an iframe
. There is a certain approach when handling iframes which your can read here. But in simple terms it means: You need to switch to the iframe which is seen as a seperate window by Selenium.
iframe
of the HTML element you try to interactiframe
, you can now interact with the proper HTML element //label[contains(text(), 'Server address')]/following-sibling::input