为什么模态窗口没有出现在Selenium和Python中

时间:2014-01-31 08:59:22

标签: javascript python html ajax selenium

我正在使用Selenium和Python。单击此处的图像元素:

element = wait.until(EC.element_to_be_clickable((By.XPATH,'(//td[span[normalize-space(text())="Ram Lal"]])[1]/following-sibling::td[./input[@type="image"]]')))

这是按钮用于恢复页面的内容,这在Selenium中不会发生:

<input type="image" src="/rhis/images/add2.png" onclick="A4J.AJAX.Submit('modalFormResultPatientSearchPatientSearchForm',event,{'oncomplete':function(request,event,data){Richfaces.hideModalPanel('modalFormResultPatientSearch');},'similarityGroupingId':'modalFormResultPatientSearchPatientSearchForm:patientSearchDataTableId:0:patientContorlsubmitSearch','parameters':{'backingBeanName':'','patientId':'903242','patSearchMrno':'UH0000004013','onPatientSelectCallBack':'','modalFormResultPatientSearchPatientSearchForm:patientSearchDataTableId:0:patientContorlsubmitSearch':'modalFormResultPatientSearchPatientSearchForm:patientSearchDataTableId:0:patientContorlsubmitSearch'} ,'eventsQueue':'modalFormResultPatientSearchsearcha4jQueue'} );return false;" name="modalFormResultPatientSearchPatientSearchForm:patientSearchDataTableId:0:patientContorlsubmitSearch" id="modalFormResultPatientSearchPatientSearchForm:patientSearchDataTableId:0:patientContorlsubmitSearch">

我假设这是一个模态窗口问题,我徒劳地尝试了这个技巧:

driver.execute_script('var el=arguments[0]; setTimeout(function() { el.click(); }, 100);', element)

新模态窗口不出现的原因是什么?

0 个答案:

没有答案