'Unable to locate element' error in selenium-python

0

I' am new to selenium and python also. I have below code which calls java-script function and loads new web page. Then I want to add dates in 2 input fields but getting error. I can see the webpage though. Any help please. Python code:

    # Call java fuction and web page loads
    driver.execute_script('javascript:parent.gotoSearch(\'advanced\')')
    # Add below dates in input fields
    time.sleep(20)
    openf = driver.find_element_by_id("openedFrom_dateText")
    opent = driver.find_element_by_id("openedTo_dateText")
    openf.send_keys("01-01-2015")
    opent.send_keys("02-01-2015")
    time.sleep(20)
    driver.find_element_by_xpath('//button[@type="submit"]').submit()

Error:

selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="openedFrom_dateText"]

Samadhan Gaikwad

Posted 2017-12-05T18:15:24.937

Reputation: 43

I realized these fields are in the iframe, working on it. – Samadhan Gaikwad – 2017-12-07T05:13:58.153

No answers