Example #1
0
 def test_02surgeryNum(self):
     num_surgery = SyfClinicalReport.num_surgery()
     print num_surgery
Login.maxmize_window()
HospitalNums = operateExcel.All_content('Hid')

n = operateExcel.max_row('pathology')+1  # excel row
SyfClinicalReport.goto_Report()
for Hid in HospitalNums:   #遍历要测试的病历号
    # ReportList.goto_reportList()
    # ReportList.del_checkCode(Hid)        #删除该病历号下的校验代码化内容
    SyfClinicalReport.input_Hid(Hid)
    is_disappeared = WebDriverWait(driver, 20, 1).until_not(
        lambda x: x.find_element_by_xpath('//div[@class="divBlockHid"]').is_displayed())
    if is_disappeared:
        globals.log(Hid+' '+"手术信息加载超时")
        continue
    surgeryList = driver.find_element_by_id('selShouShuList')
    num_operations= SyfClinicalReport.num_surgery()
    if num_operations == 0:
        globals.log(str(num_operations))
        globals.log(Hid+"手术次数未获取到")
        continue
    for i in range(num_operations):  # 遍历手术次数
        SyfClinicalReport.wait_loading()
        surgeryList.click()
        # 判断是否有alert并关闭
        SyfClinicalReport.alert_close()
        surgeryList.find_elements_by_tag_name('option')[i].click()
        sleep(2)
        #判断是否有alert并关闭
        SyfClinicalReport.alert_close()
        SyfClinicalReport.wait_loading()
        driver.find_element_by_id('txtCheckReportType').click()