Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/403.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 为什么模式窗口没有取代Selenium 2和Python中较早的窗口?_Javascript_Python_Selenium Webdriver - Fatal编程技术网

Javascript 为什么模式窗口没有取代Selenium 2和Python中较早的窗口?

Javascript 为什么模式窗口没有取代Selenium 2和Python中较早的窗口?,javascript,python,selenium-webdriver,Javascript,Python,Selenium Webdriver,我正在使用Selenium-2和Python。点击一个图像,我会得到一个新的模式窗口来代替当前的模式窗口。新窗口不会出现。这是我单击的图像的代码。你能猜出为什么新的模态窗口没有打开吗 未显示的目标模式窗口为 创建遭遇战 单击按钮并期望转到目标窗口的Python代码。它单击“找到按钮”并挂起:- element = driver.find_element_by_id('modalFormResultPatientSearchPatientSearchForm:searchTable__pat

我正在使用
Selenium-2
Python
。点击一个图像,我会得到一个新的模式窗口来代替当前的模式窗口。新窗口不会出现。这是我单击的图像的代码。你能猜出为什么新的模态窗口没有打开吗

未显示的目标模式窗口为

创建遭遇战

单击按钮并期望转到目标窗口的Python代码。它单击“找到按钮”并挂起:-

  element = driver.find_element_by_id('modalFormResultPatientSearchPatientSearchForm:searchTable__patientSearchDataTableId:0:propertyField')
    element.send_keys('Patient Name')


    element = driver.find_element_by_id('modalFormResultPatientSearchPatientSearchForm:searchTable__patientSearchDataTableId:0:textValueField')
    element.clear()

    try:
        wait = WebDriverWait(driver, 10)
        element = driver.find_element_by_xpath('//div[@id="modalFormResultPatientSearchPatientSearchForm:searchTable__patientSearchDataTableId:0:j_id845"]/select[@name="modalFormResultPatientSearchPatientSearchForm:searchTable__patientSearchDataTableId:0:j_id847"]')

    except:
        driver.quit()


    element = driver.find_element_by_id('modalFormResultPatientSearchPatientSearchForm:searchTable__patientSearchDataTableId:0:textValueField')
    element.send_keys('Ram Lal')

    element = driver.find_element_by_id('modalFormResultPatientSearchPatientSearchForm:searchTable__patientSearchDataTableId:commonSearchButton')
    element.click()

    try:
        element = driver.find_element_by_xpath('//td[span[normalize-space(text())="Ram Lal"]][1]/following-sibling::td[./input[@type="image"]]')
        action = ActionChains(driver)
        action.double_click(element)
        action.perform()
        print 'i found the button !'
    except:
        print 'i did not find the button'
        pass

Python中的Selenium代码在哪里???我添加了Python代码中应该调用新模式窗口的部分。