Example #1
0
    def test003(self):
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  # 点击收费/发药
        time.sleep(3)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.CSS_SELECTOR,
                "#content > div.charge.subhead > div > div > ul > li:nth-child(4) > a"
            )))  #
        ys.click()  # 点击结算管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_excel"]/tbody/tr[1]/td[14]/a').click()  # 点击详情
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="printgroup"]/a/span')  # 滑动到代收付页面最底部
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到代收付页面最底部
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="printgroup"]/a/span').click()  # 点击退费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[3]/div[3]/table/thead/tr/th[1]/label/input'
        ).click()  # 点击全选
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[3]/div[7]/span')  # 滑动到提交按钮
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到提交按钮

        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[3]/div[5]/div[2]/p'
        ).send_keys(u"不满意,不想要了")  # 填写退费原因
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[3]/div[7]/span').click(
            )  # 点击提交
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "layui-layer-btn0")))  #
        ys.click()  # 点击退费弹窗中的确定
        time.sleep(15)
        browser.back()
        time.sleep(3)
Example #2
0
 def test002(self):
     browser.find_element_by_xpath('/html/body/div[3]/aside/section/ul/li[2]/ul/li[1]/a').click()  # 点击预约挂号
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="registerName_input"]').send_keys(u"董焕焕")  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="registerName_searchRelate"]/p[1]').click()  # 列表中选择董焕焕
     time.sleep(5)
     browser.find_element_by_xpath('//*[@id="addRegister_save"]').click()  # 点击保存
     # browser.find_element_by_xpath('//*[@id="presprint_1"]').click()  # 点击保存与打印
     # time.sleep(5)
     # browser.back()
     time.sleep(2)
     browser.find_element_by_xpath('/html/body/div[3]/aside/section/ul/li[2]/ul/li[2]/a').click()  # 点击医生工作台
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="doctorDesk_nav"]/ul/li[1]/a').click()  # 点击今日就诊
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="doctor_patient_cart_content"]/div/div[2]/span[1]').click()  # 点击接诊
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[1]/a').click()  # 点击病例
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="HistoryCase"]').click()  # 点击历史病例
     time.sleep(2)
     browser.current_window_handle
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.CLASS_NAME, "layui-layer-setwin")))  # 点击总关闭
     ys.click()
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[2]/a').click()  # 点击检验项目
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="HistoryCase"]').click()  # 点击查看历史病例
     time.sleep(2)
     browser.current_window_handle
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.CLASS_NAME, "layui-layer-setwin")))  # 点击总关闭
     ys.click()
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[3]/a').click()  # 点击检查项目
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="HistoryCase"]').click()  # 点击查看历史病例
     time.sleep(2)
     browser.current_window_handle
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.CLASS_NAME, "layui-layer-setwin")))  # 点击总关闭
     ys.click()
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[4]/a').click()  # 点击治疗
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="HistoryCase"]').click()  # 点击查看历史病例
     time.sleep(2)
     browser.current_window_handle
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.CLASS_NAME, "layui-layer-setwin")))  # 点击总关闭
     ys.click()
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[5]/a').click()  # 点击处方
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="HistoryCase"]').click()  # 点击查看历史病例
     time.sleep(2)
     browser.current_window_handle
     ys = WebDriverWait(browser ,20 ,0.5).until(EC.presence_of_element_located((By.XPATH ,'//*[@id="caseLists"]/li/div[1]/span[4]'))  )  # 点击总的展开
     ys.click()
     time.sleep(2)
     ys = WebDriverWait(browser ,20 ,0.5).until(EC.presence_of_element_located((By.XPATH ,'//*[@id="caseLists"]/li/div[2]/h4/span'))  )  # 点击病例处的展开
     ys.click()
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li/div[2]/h4/span')))
     ys.click()# 点击病例处的收起
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li/div[2]/div[5]/h4/span[1]')))  # 点击处方处的展开
     ys.click()
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li/div[2]/div[5]/h4/span[1]')))  # 点击处方处的收起
     ys.click()
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li/div[2]/div[6]/div/h4/span')))  # 点击中药处方处的展开
     ys.click()
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li[1]/div[2]/div[6]/div/h4/span')))  # 点击中药处方处的收起
     ys.click()
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li[1]/div[2]/div[5]/h4/span[2]')))  # 点击引用处方
     ys.click()
     time.sleep(2)
     target = browser.find_element_by_xpath('//*[@id="caseLists"]/li/div[2]/div[6]/div/h4')  #
     browser.execute_script("arguments[0].scrollIntoView();", target)  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[6]/a').click()  # 点击草药处方
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="HistoryCase"]').click()  # 点击查看历史病例
     time.sleep(2)
     browser.current_window_handle
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li[1]/div[1]/span[4]')))
     ys.click()  #点击总的展开
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li[1]/div[2]/div[6]/div/h4/span')))  #
     ys.click()  #点击中药处方的展开
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="caseLists"]/li[1]/div[2]/div[6]/div/div/ul/li[1]/p[1]/span[2]')))  #
     ys.click()  #点击引用该处方
     time.sleep(2)
Example #3
0
    def test001(self):
        p.login()
        #挂账管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  #点击收费发药
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[5]').click()  #点击挂账管理
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="char5_date1"]').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_YY"]/label').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_ys"]/li[1]').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_ok"]').click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div/ul/li[2]/span/span[1]/span/span[2]'
        ).click()  #点击收银员
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"董焕焕")  #测试
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div/ul/li[2]/span/span[1]/span/span[2]'
        ).click()  # 点击收银员测试
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"全部")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #
        time.sleep(1)
        browser.find_element_by_id("orderNumber").send_keys("171031192600205")
        time.sleep(1)
        browser.find_element_by_css_selector("button.searchBtn").click()
        time.sleep(1)
        browser.find_element_by_id("orderNumber").clear()
        browser.find_element_by_id("orderNumber").send_keys("")
        browser.find_element_by_id("patientMessage").clear()
        browser.find_element_by_id("patientMessage").send_keys(u"董焕焕")
        browser.find_element_by_css_selector("button.searchBtn").click()
        time.sleep(1)
        browser.find_element_by_id("patientMessage").clear()
        browser.find_element_by_id("patientMessage").send_keys("18611059298")
        browser.find_element_by_css_selector("button.searchBtn").click()
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div/div/div').click()  #导出Excel表格
        time.sleep(2)
        browser.find_element_by_id("patientMessage").clear()
        browser.find_element_by_css_selector("button.searchBtn").click()
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="gztable"]/tbody/tr[1]/td[10]').click()  #点击详情
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[2]/div[7]/span[2]'
        )  #
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  #滑动到打印
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[2]/div[7]/span[1]'
        ).click()  #点击收费
        time.sleep(5)

        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)

        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[2]/div[1]/i[1]'
                 )))  #
        ys.click()  #选择现金
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[2]/div[1]/input'
                 )))  #
        ys.clear()
        ys.send_keys(u"645.00")  # 输入现金金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[2]/div[2]/i[1]'
                 )))  #
        ys.click()  # 选择刷卡
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[2]/div[2]/input'
                 )))  #
        ys.clear()
        ys.send_keys(u"500.00")  # 输入刷卡金额
        time.sleep(5)
        # ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="layui-layer11"]/div[2]/div/ul/li[3]/div[1]/i[1]')))  #
        # ys.click()  #选择微信
        # time.sleep(5)
        # ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="layui-layer11"]/div[2]/div/ul/li[3]/div[1]/input')))  #
        # ys.clear()
        # ys.send_keys(u"0.01")  # 输入微信金额
        # time.sleep(5)
        # ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="layui-layer11"]/div[2]/div/ul/li[3]/div[2]/i[1]')))  #
        # ys.click()  #选择支付宝
        # time.sleep(5)
        # ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="layui-layer11"]/div[2]/div/ul/li[3]/div[2]/input')))  #
        # ys.clear()
        # ys.send_keys(u"0.01")  # 输入支付宝金额
        # time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[4]/div[1]/i[1]'
                 )))  #个人汇款
        ys.click()  # 选择个人汇款
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[4]/div[1]/input'
                 )))  # 输入个人汇款金额
        ys.clear()
        ys.send_keys(u"500")  # 输入个人汇款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[4]/div[2]/i[1]'
                 )))  # 公司汇款
        ys.click()  # 选择公司汇款
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[4]/div[2]/input'
                 )))  # 公司汇款
        ys.clear()
        ys.send_keys(u"500")  # 输入公司汇款金额
        time.sleep(5)
        # ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="layui-layer11"]/div[2]/div/ul/li[5]/div[1]/i[1]')))  # 选择储值卡
        # ys.click()  # 选择储值卡
        # time.sleep(5)
        # ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="layui-layer11"]/div[2]/div/ul/li[5]/div[1]/input')))  # 储值卡输入金额
        # ys.clear()
        # ys.send_keys(u"500")   # 储值卡输入金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[5]/div[2]/i[1]'
                 )))  # 选择其他
        ys.click()  # 选择其他
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer10"]/div[2]/div/ul/li[5]/div[2]/input'
                 )))  # 其他输入金额
        ys.clear()
        ys.send_keys(u"1000")  # 其他输入金额
        time.sleep(5)
        target = browser.find_element_by_xpath(
            '//*[@id="print_buying"]')  #滑动到确定
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="print_buying"]')))  #
        ys.click()  #点击确定
        time.sleep(5)
        browser.back()

        # #保险回款
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  #点击收费发药
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[6]/a').click()  #点击保险回款
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="char6_date1"]').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_YY"]/label').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_ys"]/li[1]').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_ok"]').click()  #
        time.sleep(10)
        ys = WebDriverWait(browser, 40, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="ajax-content"]/div/div/div[1]/ul[1]/li[2]/input[1]'
                 )))  #
        ys.send_keys(u"0")  #待回款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 40, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="ajax-content"]/div/div/div[1]/ul[1]/li[2]/input[2]'
                 )))  #
        ys.send_keys(u"700")  #待回款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="ajax-content"]/div/div/div[1]/ul[1]/li[2]/input[2]'
                 )))  #
        ys.clear()  #清除待回款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="ajax-content"]/div/div/div[1]/ul[1]/li[2]/input[1]'
                 )))  #
        ys.clear()  #清除待回款金额
        time.sleep(20)
        ys = WebDriverWait(browser, 30, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="ajax-content"]/div/div/div[1]/ul[1]/li[3]/span/span[1]/span/span[2]'
            )))  #
        ys.click()  #点击保险公司
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"兴业银行")  #
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div[1]/ul[1]/li[3]/span/span[1]/span/span[2]'
        ).click()  #点击保险公司
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"全部")  #
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)
        time.sleep(10)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="charge6_no"]')))  #
        ys.click()  #
        time.sleep(10)
        browser.find_element_by_xpath(
            '//*[@id="charge6_nozero"]').click()  #勾选拒付非0
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="charge6_no"]').click()  #去掉勾选0回款
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="charge6_nozero"]').click()  #去掉勾选拒付非0
        time.sleep(5)
        browser.find_element_by_xpath('//*[@id="patientMessage"]').send_keys(
            u"董焕焕")  #
        time.sleep(10)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.CSS_SELECTOR,
                "#ajax-content > div > div > div.charge6_head > ul.container-fluid.charge6_head2 > li > button"
            )))  #
        ys.click()  #点击查询
        time.sleep(5)
        browser.find_element_by_xpath('//*[@id="patientMessage"]').clear()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="patientMessage"]').send_keys(
            u"18611059298")  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div[1]/ul[2]/li/button').click(
            )  #点击查询
        time.sleep(8)
        browser.find_element_by_xpath('//*[@id="patientMessage"]').clear()  #
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="charge6_table"]/tbody/tr[1]/td[11]/span[1]').click(
            )  #点击回款
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "charge6_popu1Inp")))  #
        ys.send_keys(u"0.01")  #
        time.sleep(1)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="charge6_popu1time"]')))  #
        ys.clear()  #
        ys.send_keys(u"2017-11-01")  #
        time.sleep(1)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "charge6_popu1_remark")))  #
        ys.send_keys(u"保险回款")  #
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "charge6_popu1_btn")))  #
        ys.click()  #点击确定
        time.sleep(8)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.CSS_SELECTOR,
                "#charge6_table > tbody > tr:nth-child(1) > td.long.noExl > span.refuseMoney"
            )))  #
        ys.click()  #点击拒付
        time.sleep(5)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, 'charge6_popu2Inp')))  #
        ys.send_keys(u"200")
        time.sleep(1)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "charge6_popu2time")))  #
        ys.clear()  #
        ys.send_keys(u"2017-11-05")
        time.sleep(1)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "charge6_popu2_remark")))  #
        ys.send_keys(u"拒付")
        time.sleep(1)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "charge6_popu2_btn")))  #
        ys.click()  #点击确定
        time.sleep(8)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.CSS_SELECTOR,
                "#charge6_table > tbody > tr:nth-child(1) > td.long.noExl > span.seeNote"
            )))  #
        ys.click()  #点击查看备注
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, 'layui-layer-setwin')))  #
        ys.click()  #点击关闭
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div[2]/div/span').click(
            )  #点击导出Excel
        time.sleep(2)
Example #4
0
    def test002(self):  # 点击收费/发药
        global browser
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  # 点击收费/发药
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[2]/a').click()  #点击收费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/ul/li/div/div[2]'
        ).click()  #点击待收费
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/form/div/div[2]/div[11]/ol'
        )  # 滑动到代收付页面最底部
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到代收付页面最底部
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/form/div/div[2]/div[10]/p[1]/i'
        ).click()  # 点击收费
        time.sleep(2)

        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="layui-layer4"]/div[2]/div/ul/li[2]/div[1]/i[1]')))  #
        ys.click()  #选择现金
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[2]/div[1]/input'
                 )))  #
        ys.clear()
        ys.send_keys(u"456.49")  # 输入现金金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="layui-layer4"]/div[2]/div/ul/li[2]/div[2]/i[1]')))  #
        ys.click()  # 选择刷卡
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[2]/div[2]/input'
                 )))  #
        ys.clear()
        ys.send_keys(u"1000.00")  # 输入刷卡金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[4]/div[1]/i[1]'
                 )))  #个人汇款
        ys.click()  # 选择个人汇款
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[4]/div[1]/input'
                 )))  # 输入个人汇款金额
        ys.clear()
        ys.send_keys(u"500")  # 输入个人汇款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[4]/div[2]/i[1]'
                 )))  # 公司汇款
        ys.click()  # 选择公司汇款
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[4]/div[2]/input'
                 )))  # 公司汇款
        ys.clear()
        ys.send_keys(u"500")  # 输入公司汇款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[5]/div[2]/i[1]'
                 )))  # 选择其他
        ys.click()  # 选择其他
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer4"]/div[2]/div/ul/li[5]/div[2]/input'
                 )))  # 其他输入金额
        ys.clear()
        ys.send_keys(u"1000")  # 其他输入金额
        time.sleep(5)
        target = browser.find_element_by_xpath(
            '//*[@id="print_buying"]')  #滑动到确定
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="print_buying"]')))  #
        ys.click()  #点击确定
        time.sleep(5)
        browser.back()
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[2]').click()  #点击收费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="constList"]/div[1]/div[1]/span[2]').click()  # 点击已收费状态
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="constList"]/div[2]/ul/li[1]/div/div[2]').click(
            )  # 点击已收费按钮
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[2]/div[7]/span'
        )  # 滑动到打印账单详情页面最底部
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到账单详情页面最底部
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[2]/div[7]/span'
        ).click()  # 点击打印账单
        time.sleep(5)
        browser.back()
        time.sleep(2)
Example #5
0
    def test002(self):  # 点击收费/发药
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  # 点击收费/发药
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[2]/a').click()  # 点击收费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="constList"]/div[2]/ul/li[1]/div/div[3]').click()  #点击追加
        time.sleep(2)
        target = browser.find_element_by_xpath('//*[@id="addSave"]')  #滑动到收费并保存
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(
            u"性纱布块")  #一次性纱布块
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[1]').click()  #选择一次性纱布块
        time.sleep(3)
        browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(
            u"1")  #专家异地出诊交通费1
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[1]').click()  #选择专家异地出诊交通费1
        time.sleep(3)
        browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(
            u"2")  #专家异地出诊交通费2
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[1]').click()  # 选择专家异地出诊交通费2
        time.sleep(3)
        browser.find_element_by_xpath('//*[@id="addSave"]').click()  #点击保存并收费
        time.sleep(5)
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/form/div/div[2]/div[10]/p[1]/i'
        )  #滑动到收费
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/form/div/div[2]/div[10]/p[1]/i'
        ).click()  #点击收费
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)

        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="layui-layer6"]/div[2]/div/ul/li[2]/div[1]/i[1]')))  #
        ys.click()  #选择现金
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[2]/div[1]/input'
                 )))  #
        ys.clear()
        ys.send_keys(u"1039.28")  # 输入现金金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="layui-layer6"]/div[2]/div/ul/li[2]/div[2]/i[1]')))  #
        ys.click()  # 选择刷卡
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[2]/div[2]/input'
                 )))  #
        ys.clear()
        ys.send_keys(u"1000.00")  # 输入刷卡金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[4]/div[1]/i[1]'
                 )))  #个人汇款
        ys.click()  # 选择个人汇款
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[4]/div[1]/input'
                 )))  # 输入个人汇款金额
        ys.clear()
        ys.send_keys(u"1000")  # 输入个人汇款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[4]/div[2]/i[1]'
                 )))  # 公司汇款
        ys.click()  # 选择公司汇款
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[4]/div[2]/input'
                 )))  # 公司汇款
        ys.clear()
        ys.send_keys(u"1000")  # 输入公司汇款金额
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[5]/div[2]/i[1]'
                 )))  # 选择其他
        ys.click()  # 选择其他
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="layui-layer6"]/div[2]/div/ul/li[5]/div[2]/input'
                 )))  # 其他输入金额
        ys.clear()
        ys.send_keys(u"2000")  # 其他输入金额
        time.sleep(5)
        target = browser.find_element_by_xpath(
            '//*[@id="print_buying"]')  #滑动到确定
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="print_buying"]')))  #
        ys.click()  #点击确定
        time.sleep(3)
        browser.back()
        time.sleep(3)

        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[2]').click()  #点击收费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="constList"]/div[1]/div[1]/span[2]').click()  # 点击已收费状态
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="constList"]/div[2]/ul/li[1]/div/div[2]').click(
            )  # 点击已收费按钮
        time.sleep(3)
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[2]/div[7]/span'
        )  # 滑动到打印账单详情页面最底部
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到账单详情页面最底部
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[2]/div[7]/span'
        ).click()  # 点击打印账单
        time.sleep(2)
        browser.back()
        time.sleep(2)
Example #6
0
    def test002(self):
        global browser
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  # 点击收费/发药
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[1]').click()  # 点击发药
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/ul/li[1]/div/div[2]'
        ).click()  # 点击待发药
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="Allboxs"]/div[3]/div[3]/span').click()  # 西药发药点击确定
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, 'charge3_poup_btn')))  #
        ys.click()  # 弹窗中点击确定
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="Allboxs"]/div[3]/div[5]/span').click()  # 耗材发药点击确定
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "HC_charge3_poup_btn")))  #
        ys.click()  # 弹窗中点击确定
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="Vuelist"]/div/div[3]/span').click()  # 草药发药点击确定
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, 'ZY_charge2_poup_btn')))  #
        ys.click()  # 弹窗中点击确定
        time.sleep(3)

        browser.find_element_by_xpath(
            '//*[@id="taocanList"]/div/span').click()  # 套餐发药点击确定
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, 'charge3_poup_btn')))  #
        ys.click()  # 弹窗中点击确定
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[1]/span[2]').click(
            )  # 点击已完成
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/ul/li/div/div[2]'
        ).click()  # 点击已发药
        time.sleep(2)
        time.sleep(2)
        target = browser.find_element_by_xpath('//*[@id="DrugRuturn"]')  #
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到退药
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="DrugRuturn"]').click()  # 点击退药
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, 'charge8_poup_btn')))  #
        ys.click()  # 弹窗中点击确定
        time.sleep(3)
Example #7
0
    def test002(self):
        time.sleep(2)
        browser.find_element_by_css_selector(
            "body > div.wrapper > aside > section > ul > li.treeview.active > ul > li:nth-child(7) > a"
        ).click()  #点击收费、发药
        time.sleep(2)
        browser.find_element_by_link_text(u"直接售药").click()  # 点击直接售药
        time.sleep(2)
        browser.find_element_by_name("name").click()  #
        browser.find_element_by_name("name").clear()  #
        browser.find_element_by_name("name").send_keys(u"直接售药")  # 输入姓名
        browser.find_element_by_name("mobile").click()  #
        browser.find_element_by_name("mobile").clear()  #
        browser.find_element_by_name("mobile").send_keys(
            "18611059298")  # 输入手机号
        browser.find_element_by_id("female").click()  #
        browser.find_element_by_name("age").clear()  #
        browser.find_element_by_name("age").send_keys("30")  # 输入年龄
        browser.find_element_by_id("hidden_search_yao").clear()  #
        browser.find_element_by_id("hidden_search_yao").send_keys(
            u"阿奇霉素注射液")  # 输入药品阿奇霉素注射液
        time.sleep(1)
        browser.find_element_by_xpath(
            "//tbody[@id='cont_yaos']/tr/td[4]").click()  # 选择药品阿奇霉素注射液
        time.sleep(1)
        browser.find_element_by_id("hidden_search_yao").clear()  #
        browser.find_element_by_id("hidden_search_yao").send_keys(
            u"达克宁")  # 输入药品达克宁
        time.sleep(1)
        browser.find_element_by_xpath(
            "//tbody[@id='cont_yaos']/tr/td[3]").click()  # 选择药品达克宁
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/form/table/tbody/tr[2]/td[9]/input'
        ).clear()  #
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/form/table/tbody/tr[2]/td[9]/input'
        ).send_keys("2")  # 输入数量
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="select2-charge3_fee-container"]').click()  #点击费别处的请选择
        browser.find_element_by_css_selector(
            "input.select2-search__field").clear()  #
        browser.find_element_by_css_selector(
            "input.select2-search__field").send_keys(u"VIP")  # 输入费别
        browser.find_element_by_css_selector(
            "input.select2-search__field").send_keys(Keys.ENTER)  #选择费别
        time.sleep(1)
        browser.find_element_by_css_selector("input.privilege").clear()  #
        browser.find_element_by_css_selector("input.privilege").send_keys(
            "16.28")  # 输入优惠金额
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="suer_order"]')  # 滑动到代收付页面最底部
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到代收付页面最底部
        time.sleep(2)
        browser.find_element_by_id("suer_order").click()  # 点击收费
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector(
            "p.charge3_poup_btn").click()  # 弹窗中点击确定
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_xpath(
            "(//input[@name='chioce_radio'])[3]").click()  # 收费弹窗中点击微信
        time.sleep(1)
        browser.find_element_by_xpath(
            "(//input[@name='chioce_radio'])[4]").click()  # 收费弹窗中点击支付宝
        time.sleep(1)
        browser.find_element_by_xpath(
            "(//input[@name='chioce_radio'])[2]").click()  # 收费弹窗中点击刷卡
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="suerPrint"]').click()  #收费弹窗中点击确定
        time.sleep(4)
        browser.back()
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[4]').click()  #点击结算管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_excel"]/tbody/tr[1]/td[14]/a').click()  #点击详情
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[9]/span').click(
            )  #点击修改打印账单
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="settledate1"]').clear()  #修改日期
        browser.find_element_by_xpath('//*[@id="settledate1"]').send_keys(
            u"2017-12-18")  #修改日期
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[5]/table/tbody/tr[1]/td[2]/input'
        ).send_keys(u"修改药品名称")  #修改药品名称
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[5]/table/tbody/tr[1]/td[5]/input'
        ).send_keys(u"修改药品名称")  #修改售价单位
        browser.find_element_by_xpath(
            '//*[@id="printgroup1"]/span[1]').click()  #点击打印
        time.sleep(2)
        browser.back()  # 浏览器返回
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_excel"]/tbody/tr[1]/td[14]/a').click()  # 点击详情
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[9]/a/span').click(
            )  #点击退费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[7]/div[2]/p'
        ).send_keys(u"不想要了")  #
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[11]/span')  # 滑动到提交处
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到代收付页面最底部
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[11]/span').click(
            )  #点击提交
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="layui-layer1"]/div[2]/div/p').click()  # 弹窗中点击确定
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="layui-layer2"]/div[3]/a[1]')))  #
        ys.click()  #点击确认
        time.sleep(4)
        browser.back()  # 浏览器返回
        time.sleep(3)

        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  # 点击收费、发药
        time.sleep(2)
        browser.find_element_by_link_text(u"直接售药").click()  # 点击直接售药
        time.sleep(2)
        browser.find_element_by_name("name").click()  #
        browser.find_element_by_name("name").clear()  #
        browser.find_element_by_name("name").send_keys(u"直接售药")  # 输入姓名
        time.sleep(2)
        browser.find_element_by_name("mobile").click()  #
        browser.find_element_by_name("mobile").clear()  #
        browser.find_element_by_name("mobile").send_keys(
            "18611059298")  # 输入手机号
        browser.find_element_by_id("female").click()  #
        browser.find_element_by_name("age").clear()  #
        browser.find_element_by_name("age").send_keys("30")  # 输入年龄
        browser.find_element_by_id("hidden_search_yao").clear()  #
        browser.find_element_by_id("hidden_search_yao").send_keys(
            u"阿奇霉素注射液")  # 输入药品阿奇霉素注射液
        time.sleep(1)
        browser.find_element_by_xpath(
            "//tbody[@id='cont_yaos']/tr/td[4]").click()  # 选择药品阿奇霉素注射液
        time.sleep(1)
        browser.find_element_by_id("hidden_search_yao").clear()  #
        browser.find_element_by_id("hidden_search_yao").send_keys(
            u"达克宁")  # 输入药品达克宁
        time.sleep(1)
        browser.find_element_by_xpath(
            "//tbody[@id='cont_yaos']/tr/td[3]").click()  # 选择药品达克宁
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/form/table/tbody/tr[2]/td[9]/input'
        ).clear()  #
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/form/table/tbody/tr[2]/td[9]/input'
        ).send_keys("2")  # 输入数量
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="select2-charge3_fee-container"]').click()  # 点击费别处的请选择
        browser.find_element_by_css_selector(
            "input.select2-search__field").clear()  #
        browser.find_element_by_css_selector(
            "input.select2-search__field").send_keys(u"VIP")  # 输入费别
        browser.find_element_by_css_selector(
            "input.select2-search__field").send_keys(Keys.ENTER)  # 选择费别
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="suer_order"]')  # 滑动到代收付页面最底部
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到代收付页面最底部
        time.sleep(2)
        browser.find_element_by_id("suer_order").click()  # 点击收费
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector(
            "p.charge3_poup_btn").click()  # 弹窗中点击确定
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_xpath(
            "(//input[@name='chioce_radio'])[3]").click()  # 收费弹窗中点击微信
        time.sleep(1)
        browser.find_element_by_xpath(
            "(//input[@name='chioce_radio'])[4]").click()  # 收费弹窗中点击支付宝
        time.sleep(1)
        browser.find_element_by_xpath(
            "(//input[@name='chioce_radio'])[2]").click()  # 收费弹窗中点击刷卡
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="suerPrint"]').click()  # 收费弹窗中点击确定
        time.sleep(2)
        browser.back()  # 浏览器返回
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[4]').click()  # 点击结算管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_excel"]/tbody/tr[1]/td[14]/a').click()  # 点击详情
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[9]/span').click(
            )  # 点击打印账单
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="settledate1"]').clear()  #修改日期
        browser.find_element_by_xpath('//*[@id="settledate1"]').send_keys(
            u"2017-12-18")  #修改日期
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[5]/table/tbody/tr[1]/td[2]/input'
        ).send_keys(u"修改药品名称")  #修改药品名称
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[5]/table/tbody/tr[1]/td[5]/input'
        ).send_keys(u"修改药品名称")  #修改售价单位
        browser.find_element_by_xpath(
            '//*[@id="printgroup1"]/span[1]').click()  #点击打印
        time.sleep(2)
        browser.back()  # 浏览器返回
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_excel"]/tbody/tr[1]/td[14]/a').click()  # 点击详情
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[9]/a/span').click(
            )  # 点击退费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[5]/table/tbody/tr[1]/td[1]/label'
        ).click()  # 选择退费项目
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[7]/div[2]/p'
        ).send_keys(u"不想要了")  #
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[11]/span')  # 滑动到提交处
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到代收付页面最底部
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/div[11]/span').click(
            )  # 点击提交
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="layui-layer1"]/div[2]/div/p').click()  # 弹窗中点击确定
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="layui-layer2"]/div[3]/a[1]')))  #
        ys.click()  # 点击确认
        time.sleep(2)
        browser.back()  # 浏览器返回
        time.sleep(2)

        # #盘库
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[5]/a/span[1]').click(
            )  # 点击诊所管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[5]/ul/li[1]/a').click(
            )  #点击药房
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="layui-layer2"]/span/a').click()  # 点击关闭
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[3]/div/div/ul/li[3]').click()  #点击盘库单管理
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="startDate"]').clear()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="startDate"]').send_keys(
            u"2010-11-07")  #开始日期输入2010-11-07
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  #点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[3]/select').click()  #点击盘点人
        time.sleep(1)
        # InputType = Select(browser.find_element_by_xpath('//*[@id="home_param"]/div[3]/select'))
        # InputType.select_by_value("170831113200005")#盘点人选择董焕焕
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  #点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[3]/select').click()  #点击盘点人
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[3]/select'))
        InputType.select_by_value("")  # 盘点人选择请选择
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[2]/select').click()  #点击库房
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[2]/select'))
        InputType.select_by_value("1")  # 库房选择全库
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  #点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[2]/select').click()  #点击库房
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[2]/select'))
        InputType.select_by_value("2")  # 库房选择药品
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[2]/select').click()  # 点击库房
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[2]/select'))
        InputType.select_by_value("3")  # 库房选择耗材
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[2]/select').click()  # 点击库房
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[2]/select'))
        InputType.select_by_value("")  # 库房选择请选择
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[1]/select').click()  #点击状态处的请选择
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[1]/select'))
        InputType.select_by_value("1")  # 库房选择待审核
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[1]/select').click()  # 点击状态处的请选择
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[1]/select'))
        InputType.select_by_value("2")  # 库房选择已审核
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[1]/select').click()  # 点击状态处的请选择
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[1]/select'))
        InputType.select_by_value("0")  # 库房选择暂存
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="home_search"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[1]/select').click()  # 点击状态处的请选择
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="home_param"]/div[1]/select'))
        InputType.select_by_value("")  # 库房选择请选择
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="search"]').send_keys(
            u"P170929094000029")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="home_param"]/div[6]').click()  #点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[2]/button').click(
            )  #点击新增盘库单
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "layui-layer-btn0")))  #
        ys.click()  #在弹窗中点击是
        # browser.find_element_by_xpath('//*[@id="layui-layer12"]/div[3]/a[1]').click()  #在弹窗中点击是
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="layui-layer14"]/div[3]/a[1]')))  #
        ys.click()  # #在弹窗中点击忽略
        time.sleep(5)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="ajax-content"]/div/div/div[2]/ul/li[1]/ul/li/div[3]/div/input[3]'
            )))  #
        ys.click()  #点击库存非0
        time.sleep(5)
        ys = WebDriverWait(browser, 40, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="ajax-content"]/div/div/div[2]/ul/li[1]/ul/li/div[3]/div/input[1]'
            )))  #
        ys.click()  # 点击隐藏库存
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div[2]/ul/li[1]/ul/li/div[1]/select'
        ).click()  #点击库房
        time.sleep(5)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div/div[2]/ul/li[1]/ul/li/div[1]/select'
            ))
        InputType.select_by_value("1")  #选择药品
        time.sleep(10)
        browser.find_element_by_xpath(
            '//*[@id="select2-DrugName-container"]').click()  #点击药品搜索
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"阿奇霉素注射液")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="searchMedical_body"]/tr[1]/td[13]/input').clear()  #
        browser.find_element_by_xpath(
            '//*[@id="searchMedical_body"]/tr[1]/td[13]/input').send_keys(
                u"15")
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div[2]/div[2]/div/button[2]'
        ).click()  #点击暂存
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.CLASS_NAME, "layui-layer-btn0")))  #
        ys.click()  # 点击确定
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[2]/button').click(
            )  #点击新增盘库单
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="menu0"]/span[1]').click()  #点击修改
        time.sleep(10)
        browser.find_element_by_xpath(
            '//*[@id="select2-DrugName1-container"]').click()  #点击搜索药品
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"硝酸咪康唑阴道软胶囊")  #
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                Keys.ENTER)  #搜索药品“硝酸咪康唑阴道软胶囊”
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="detailTable"]/tbody/tr[1]/td[13]/input').clear()  #
        browser.find_element_by_xpath(
            '//*[@id="detailTable"]/tbody/tr[1]/td[13]/input').send_keys(u"20")
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[2]/div[4]/div/button[1]').click(
            )  #点击生产全盘单
        time.sleep(10)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[1]/div[2]/button').click(
            )  #点击新增盘库单
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="menu0"]/span[1]').click()  #点击详情
        time.sleep(10)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="ajax-content"]/div/div[2]/div[3]/button[2]')))  #
        ys.click()  #点击返回
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="menu0"]/span[4]').click()  #点击审核
        time.sleep(10)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '//*[@id="ajax-content"]/div/div[2]/div[3]/button[1]')))  #
        ys.click()  # 点击审核
        time.sleep(5)

        # #库存管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[5]/ul/li[1]/a').click(
            )  # 点击药房
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[3]/div/div/ul/li[4]').click()  #点击库存管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[2]/span').click()  #点击导出Excel
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[2]/div[1]/label[1]/input'
        ).click()  #勾选数量大于0
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[2]/div[1]/label[2]/input'
        ).click()  #勾选库存预警
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[3]/select').click(
            )  #
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[3]/select'))
        InputType.select_by_value("90")
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[2]/div[2]/label[2]/input'
        ).click()  #勾选降序
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[2]/div[4]').click()  #点击查询
        time.sleep(10)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[2]/div[1]/label[2]/input'
        ).click()  #去掉库存预警
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[3]/select').click(
            )  #
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[3]/select'))
        InputType.select_by_value("")
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[2]/div[4]').click()  #点击查询
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[1]/select[1]'
        ).click()  #点击请选择
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[1]/select[1]'))
        InputType.select_by_value("1")
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[1]/span[2]/span[1]/span/span[2]'
        ).click()  #点击全部
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"未分类")  #
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[2]/select').click(
            )  #点击药品状态
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="head_form"]/div/ul[1]/li/ul/li[1]/div[2]/select'))
        InputType.select_by_value("1")  #药品状态选择启用
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="search"]').send_keys(
            u"阿莫西林胶囊")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul[1]/li/ul/li[2]/div[4]').click(
            )  # 点击查询
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="table_fenye"]/tbody/tr/td[12]/span[1]').click()  #点击修改
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_fenye"]/tbody/tr/td[9]/input[1]').clear()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_fenye"]/tbody/tr/td[9]/input[1]').send_keys(
                u"2")  #修改预警值
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="table_fenye"]/tbody/tr/td[10]/select').click()  #点击是否启用
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="table_fenye"]/tbody/tr/td[10]/select'))
        InputType.select_by_value("1")
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="table_fenye"]/tbody/tr/td[11]/select').click()  #点击是否允许折扣
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="table_fenye"]/tbody/tr/td[11]/select'))
        InputType.select_by_value("1")  #是否允许折扣,选择是
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="table_fenye"]/tbody/tr/td[12]/span[2]').click()  #点击保存
        time.sleep(2)

        #成本管理
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[5]/ul/li[1]/a').click(
            )  #点击药房
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[3]/div/div/ul/li[5]').click()  #点击成本管理
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="search"]').send_keys(u"达克宁")  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="head_form"]/div/ul/li/ul/li/div[2]').click()  #点击查询
        time.sleep(5)
        browser.find_element_by_class_name("modify").click()  #点击修改测试环境
        # browser.find_element_by_xpath('//*[@id="9116"]/td[9]/span[1]').click()  #点击修改准正式环境
        time.sleep(1)
        browser.find_element_by_class_name("inpnum").clear()  #测试环境
        # browser.find_element_by_xpath('//*[@id="9116"]/td[6]/input').clear()  #准正式环境
        browser.find_element_by_class_name("inpnum").send_keys(u"20")  #测试环境
        # browser.find_element_by_xpath('//*[@id="9116"]/td[6]/input').send_keys(u"20")  #准正式环境
        time.sleep(1)
        browser.find_element_by_class_name("save").click()  #点击保存测试环境
        # browser.find_element_by_xpath('//*[@id="9116"]/td[9]/span[2]').click()  # 点击保存准正式环境
        time.sleep(2)

        # #汇总查询
        time.sleep(3)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[5]/ul/li[1]/a').click(
            )  #点击药房
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[3]/div/div/ul/li[6]/a').click()  #点击汇总查询
        time.sleep(1)
        browser.find_element_by_id("startDate").click()  #
        browser.find_element_by_id("startDate").clear()  #
        browser.find_element_by_id("startDate").send_keys(
            "2010-11-08")  #开始日期输入"2010-11-08"
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  #点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("1")  #自采入库
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  #点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("2")  #外购入库
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("14")  #退货入库
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(2)

        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("3")  #科室出库
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("4")  #报废出库
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("5")  #退货出库
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("6")  #调拨出库
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("7")  #处方发药
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("8")  #直接售药发药
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("11")  #库存盘盈
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("12")  #库存盘亏
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("13")  #调价
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[4]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/select').click()  # 点击全部
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="ajax-content"]/div/div[1]/div[2]/select'))
        InputType.select_by_value("")  # 选择全部
        time.sleep(1)
        browser.find_element_by_id("search").clear()  #
        browser.find_element_by_id("search").send_keys(u"阿莫")  #
        browser.find_element_by_id("data_search").click()  #点击查询
        time.sleep(3)

        #结算管理
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/a').click()  # 点击就诊流程
        time.sleep(4)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH,
                 '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a')))  #
        ys.click()  #点击收费、发药
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[4]').click()  #点击结算管理
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="char5_date1"]').click()  #点击开始日期
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_YY"]/label').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_ys"]/li[1]').click()  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="laydate_ok"]').click()  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="select2-charge5_cashier-container"]').click()  #点击全部
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"黄艳南")  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="select2-charge5_cashier-container"]').click()  # 点击全部
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"全部")  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"现金")
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"刷卡")
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"微信")
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"支付宝")
        time.sleep(1)
        browser.find_element_by_css_selector("option[value=\"4\"]").click()
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"个人汇款")
        time.sleep(1)
        browser.find_element_by_css_selector("option[value=\"5\"]").click()
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"公司汇款")
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"储值卡")
        time.sleep(1)
        browser.find_element_by_css_selector("option[value=\"7\"]").click()
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"其它")
        time.sleep(1)
        browser.find_element_by_css_selector("option[value=\"8\"]").click()
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.payment")).select_by_visible_text(u"全部")
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.kinds")).select_by_visible_text(u"门诊")
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.kinds")).select_by_visible_text(u"零售")
        time.sleep(1)
        browser.find_element_by_css_selector(
            "select.form-control.kinds > option[value=\"2\"]").click()
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.kinds")).select_by_visible_text(u"全部")
        time.sleep(1)
        browser.find_element_by_id("orderNumber").clear()
        browser.find_element_by_id("orderNumber").send_keys("171107125600026")
        browser.find_element_by_css_selector("button.searchBtn").click()
        time.sleep(1)
        browser.find_element_by_id("orderNumber").clear()
        browser.find_element_by_id("orderNumber").send_keys("")
        browser.find_element_by_id("patientMessage").clear()
        browser.find_element_by_id("patientMessage").send_keys(u"董焕焕")
        browser.find_element_by_css_selector("button.searchBtn").click()
        time.sleep(1)
        browser.find_element_by_id("patientMessage").clear()
        browser.find_element_by_id("patientMessage").send_keys("")
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.PatientType")).select_by_visible_text(
                    u"自费")
        time.sleep(1)
        Select(
            browser.find_element_by_css_selector(
                "select.form-control.PatientType")).select_by_visible_text(
                    u"保险")
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div/div[1]/div/span').click(
            )  #点击导出Excel
        time.sleep(2)
Example #8
0
    def test002(self):
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[6]/a').click()  #点击系统设置
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[6]/ul/li[1]/a').click(
            )  #点击收费项目设置
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="collect_fees"]/ul/li[4]/a').click()  #点及其他项目
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="treatment_btn"]').click()  #点击添加其他项目
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="item_name"]').send_keys(
            u"新增套餐")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="select2-ZL_item-container"]').click()  #点击项目类型
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"套餐")  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="unit_ids"]').send_keys(
            u"人次")  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="nowprice_ids"]').send_keys(
            u"1000.99")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="charging_item_btn"]').click()  #点击保存
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="tr_z0"]/td[7]/span[2]/a').click()  #点击关联项目
        time.sleep(5)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"三伏贴")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addMadiclRelateList"]/p/span[1]').click()  #选择三伏贴
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="backups_yaopin"]/td[7]/input').send_keys("1")  # 单次计量为1
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="backups_yaopin"]/td[8]/input').send_keys("1")  # 数量为1
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="backups_yaopin"]/td[9]/input').send_keys("1")  # 天数为1
        time.sleep(2)
        # browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(u"达克宁")  #
        # time.sleep(2)
        # browser.find_element_by_xpath('//*[@id="addMadiclRelateList"]/p/span[1]').click()  #选择达克宁
        # time.sleep(2)
        # browser.find_element_by_css_selector("#backups_yaopin > td:nth-child(7) > input").send_keys("1")  # 单次为1
        # time.sleep(2)
        # browser.find_element_by_css_selector("#backups_yaopin > td:nth-child(8) > input").send_keys("1")  # 数量为1
        # time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath('//*[@id="projectType"]'))  #选择耗材
        InputType.select_by_value("2")
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"一次性换药包")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[2]/div[2]/p/span[1]').click(
            )  #选择一次性换药包
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"一次性纱布块")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[2]/div[2]/p/span[1]').click(
            )  #选择一次性纱布块
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath('//*[@id="projectType"]'))  # 选择检验
        InputType.select_by_value("3")
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"脂蛋白")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[3]/div/p[1]').click()  #选择脂蛋白
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"17-羟维生素D3")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[3]/div/p').click()  #选择17-羟维生素D3
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath('//*[@id="projectType"]'))  # 选择检查
        InputType.select_by_value("4")
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"多普勒听胎心")  #
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[3]/div/p[1]').click()  #选择多普勒听胎心
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"腹部彩超")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[3]/div/p[2]').click()  #
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath('//*[@id="projectType"]'))  # 选择治疗
        InputType.select_by_value("5")
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"关节矫正复位")  #
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[2]')  #
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[1]').click()  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"颈椎正骨治疗")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[1]').click()  #
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath('//*[@id="projectType"]'))  # 选择诊费
        InputType.select_by_value("7")
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"诊费及体检费")  #
        time.sleep(2)
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[4]/div/p[4]')  #
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="additem"]/div/div[4]/div/p[4]').click()  #
        time.sleep(2)
        InputType = Select(
            browser.find_element_by_xpath('//*[@id="projectType"]'))  # 选择其他
        InputType.select_by_value("6")
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"无菌敷贴")  #
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList1"]/p[1]/span[1]')  #
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList1"]/p[1]/span[1]').click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="orherRelation_save"]').click()  #点击保存
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/table/tbody/tr[1]/td[5]'
        ).click()  #点击删除
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="orherRelation_save"]').click()  #点击保存
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="orherRelation"]').click()  #点击返回
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/a/span[1]').click(
            )  # 点击就诊流程
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[2]/a').click(
            )  #点击医生工作台
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="fasterLookDoctorBtn"]').click()  #点击快速接诊
        time.sleep(2)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="registerName_input"]').send_keys(u"套餐")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="fasterRigis_form"]/div[8]/div[1]/label').click()  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="telephonNum"]').send_keys(
            u"18611059298")  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="fasterDo"]').click()  #点击接诊
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="seeDoctoring_nav"]/ul/li[2]/a').click()  #点击检验工作台
        time.sleep(2)
        browser.refresh()
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="select2-inspectSearchInput-container"]').click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"抗核抗体ANA")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located(
                (By.XPATH, '//*[@id="seeDoctoring_nav"]/ul/li[3]/a')))  #
        ys.click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="select2-checkoutSearchLis-container"]').click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"甲状腺超声")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="seeDoctoring_nav"]/ul/li[4]/a').click()  #点击治疗
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(
            u"隔物灸法")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[1]').click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="seeDoctoring_nav"]/ul/li[5]/a').click()  #点击处方
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="addMadicine"]').send_keys(
            u"达克宁")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addMadiclRelateList"]/p/span[1]').click()  # 选择硝酸咪康唑阴道软胶囊
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="consumable_box"]/div/div[2]/input').send_keys(u"碘伏棉签")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="consumable_box"]/div/div[2]/div/div/div[2]/p/span[1]'
        ).click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="prescriptionContentBox"]/div[4]/div/div/select').click(
            )  #
        time.sleep(1)
        InputType = Select(
            browser.find_element_by_xpath(
                '//*[@id="prescriptionContentBox"]/div[4]/div/div/select'))
        InputType.select_by_value("10001000016")
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(
            u"新增套餐")  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="addOtherRelateList"]/p/span[1]').click()  #
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="otherFeeContent"]/p/span').click()  #点击套餐详情
        time.sleep(2)
        target = browser.find_element_by_xpath('//*[@id="addOtherFee"]')  #
        browser.execute_script("arguments[0].scrollIntoView();", target)  #
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="prescription_save"]').click()  #点击保存
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="prescription_print"]').click()  #点击打印
        time.sleep(5)
        browser.back()
        time.sleep(2)
        browser.find_element_by_css_selector(
            "#seeDoctoring_nav > ul > li.herbal-pres > a").click()  # 点击草药处方
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[2]/div/div[2]/div/ul/li/div/div[1]/div[1]/input'
        ).send_keys(u"荆芥")  # 在草药输入框中输入“荆芥”
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[2]/div/div[2]/div/ul/li/div/div[1]/div[1]/div/div/div[2]/p[1]/span[1]'
        ).click()  # 选择荆芥
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[2]/div/div[2]/div/ul/li/div/div[1]/span/input'
        ).clear()  # 清除
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[2]/div/div[2]/div/ul/li/div/div[1]/span/input'
        ).send_keys(30)  #
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[2]/div/div[2]/div/ul/li/div/div[2]/span[1]/img'
        ).click()  #

        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[3]/div/div/input').send_keys(
                6)  # 剂数填写6剂
        time.sleep(1)
        target = browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[4]/div/div[2]/textarea'
        )  # 滑动到处方输入框
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到处方输入框
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="herbalsPresBox"]/div/div[4]/div/div[2]/textarea'
        ).send_keys(u"饭后服用,每天2次。")
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="herbalPres_save"]').click()  # 点击保存
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="contaleBtn"]/button[4]/a').click()  #点击结束就诊
        time.sleep(5)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="offMadicalMess"]/div/a/button').click()  #
        time.sleep(2)

        # 检验工作台
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="Jiu_Zhen"]/li[3]/a').click()  # 点击检验工作台
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="inspect_patient_content"]/div[1]/div[2]/a').click(
            )  # 点击开始检验
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="inspectSavePrint"]').click()  # 点击保存与打印
        time.sleep(3)
        browser.back()  # 点击浏览器的返回
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="inspectSystm_patientCart_tab"]/li[3]/span[2]').click(
            )  # 点击已完成
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="inspect_patient_content"]/div[1]/div[2]/a').click(
            )  # 点击查看
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="againPrint"]').click()  # 点击打印报告
        time.sleep(2)
        browser.back()  # 点击浏览器的返回
        time.sleep(2)

        # 治疗工作台
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[6]/a').click(
            )  # 点击治疗
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="checkout_patient_cart_content"]/div[1]/div[2]/a').click(
            )  #点击开始治疗
        time.sleep(2)
        ys = WebDriverWait(browser, 20, 0.5).until(
            EC.presence_of_element_located((
                By.XPATH,
                '//*[@id="ajax-content"]/div[1]/div/div[2]/div[2]/div[3]/table/tbody/tr[1]/td[9]/span'
            )))  #
        ys.click()  # #点击执行
        time.sleep(3)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_link_text(u"确认").click()  #点击确定
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="treatPrint"]').click()  # 点击查看并打印
        time.sleep(2)
        browser.back()
        time.sleep(2)

        # 检查工作台
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="Jiu_Zhen"]/li[4]/a').click()  # 点击检查工作台
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="checkout_patient_cart_content"]/div[1]/div[2]/a').click(
            )  # 点击开始检查
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="chDes"]').send_keys(
            u"头疼、发烧、咳嗽、眩晕")  # 输入描述信息
        browser.find_element_by_xpath('//*[@id="chResult"]').send_keys(
            u"感冒")  # 输入结论
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="checkoutSavePrint"]').click()  # 点击保存与打印
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="inSaveYes"]').click()  # 点击继续
        time.sleep(2)
        browser.back()  # 点击浏览器的返回
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="checkout_patientCart_tab"]/li[3]/span[2]').click(
            )  # 点击已完成
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="checkout_patient_cart_content"]/div/div[2]/a').click(
            )  # 点击查看
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="checkAgainPrint"]').click()  # 点击打印报告
        time.sleep(2)
        browser.back()  # 点击浏览器的返回
        time.sleep(2)
Example #9
0
 def test002(self):
     browser.find_element_by_xpath('/html/body/div[3]/aside/section/ul/li[2]/ul/li[1]/a').click()  # 点击预约挂号
     time.sleep(5)
     browser.find_element_by_xpath('//*[@id="registerName_input"]').send_keys(u"修改其他收费")  # 输入姓名
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="telephonNum"]').send_keys("18611059298")  # 输入手机号
     browser.find_element_by_xpath('//*[@id="appointment_nav"]/ul').click()  # 点击空白处
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="select2-Order_startTime-container"]').click()  # 点击就诊时间的开始时间
     browser.find_element_by_xpath('/html/body/span/span/span[1]/input').send_keys(u"8:00")  # 就诊时间的开始时间输入9:00
     browser.find_element_by_xpath('/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  # 就诊时间的开始时间选择9:00
     browser.find_element_by_xpath('//*[@id="select2-Order_endTime-container"]').click()  # 点击结束时间
     browser.find_element_by_xpath('/html/body/span/span/span[1]/input').send_keys(u"8:30")  # 在结束时间输入10:00
     browser.find_element_by_xpath('/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  # 选择10:00
     browser.find_element_by_xpath('//*[@id="addRegister_save"]').click()  # 点击保存
     time.sleep(5)
     print("预约挂号成功")
     time.sleep(2)
     browser.find_element_by_xpath('/html/body/div[3]/aside/section/ul/li[2]/ul/li[2]/a').click()  # 点击医生工作台
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="doctor_patient_cart_content"]/div/div[2]/span[1]').click()  #点击接诊
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[5]/a').click()  #点击处方
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(u"专家异地出诊交通费1")  #输入专家异地出诊交通费1
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherRelateList"]/p/span[1]').click()  #选择专家异地出诊交通费1
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="otherFeeContent"]/form/div/div[3]/input').clear()  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="otherFeeContent"]/form/div/div[3]/input').send_keys(u"3")  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="otherFeeContent"]/form/span/input').clear()  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="otherFeeContent"]/form/span/input').send_keys(u"2000")  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="ajax-content"]/div[1]/div[2]/p[3]').click()  #点击结束就诊
     time.sleep(2)
     browser.current_window_handle  # 此行代码用来定位当前页面
     time.sleep(2)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="offMadicalMess"]/div/a/button')))  #
     ys.click()  #
     time.sleep(2)
     browser.find_element_by_xpath('/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click()  #点击收费发药
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="content"]/div[1]/div/div/ul/li[2]/a').click()  #点击收费
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="constList"]/div[2]/ul/li[1]/div/div[3]').click()  #点击追加
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(u"2")  #输入专家异地出诊交通费2
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherRelateList"]/p/span[1]').click()  #专家异地出诊交通费2
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addSave"]').click()  #点击保存并收费
     time.sleep(4)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '/html/body/div[3]/aside/section/ul/li[2]/ul/li[2]/a')))  #
     ys.click()  #点击医生工作台
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="patient_state_tab"]/li[3]').click()  # 点击已完成
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="doctor_patient_cart_content"]/div[1]/div[2]/a[2]').click()  #点击完善病例
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="seeDoctoring_nav"]/ul/li[5]/a').click()  #点击处方
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(u"2")  #输入专家异地出诊交通费2
     time.sleep(4)
     browser.find_element_by_xpath('//*[@id="addOtherRelateList"]/p/span[1]').click()  #选择专家异地出诊交通费2
     time.sleep(5)
     browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(u"3")  #输入专家异地出诊交通费3
     time.sleep(5)
     browser.find_element_by_xpath('//*[@id="addOtherRelateList"]/p/span[1]').click()  #选择专家异地出诊交通费3
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="prescription_save"]').click()  #点击保存
     time.sleep(2)
     browser.find_element_by_xpath('/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click()  #点击收费发药
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="content"]/div[1]/div/div/ul/li[2]/a').click()  #点击收费
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="constList"]/div[2]/ul/li[1]/div/div[3]').click()  #点击追加
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(u"3")  #专家异地出诊交通费3
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherRelateList"]/p/span[1]').click()  #选择专家异地出诊交通费3
     time.sleep(5)
     browser.find_element_by_xpath('//*[@id="addSave"]').click()  #点击保存与收费
     time.sleep(5)
     browser.find_element_by_xpath('//*[@id="checkform"]/div/div[2]/div[6]/div/table/tbody/tr[2]/td[8]/i').click()  #点击删除
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="addOtherFee"]').send_keys(u"4")  #输入专家异地出诊交通费4
     time.sleep(5)
     browser.find_element_by_xpath('//*[@id="addOtherRelateList"]/p/span[1]').click()  #选择专家异地出诊交通费4
     time.sleep(4)
     browser.find_element_by_xpath('//*[@id="addSave"]').click()  #点击保存与收费
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="ajax-content"]/div/div[1]/form/div/div[2]/div[5]/div/table/thead/tr/th[8]').click()  # 点击空白
     time.sleep(2)
     target = browser.find_element_by_xpath('//*[@id="buying_credit"]')  #滑动到挂账
     browser.execute_script("arguments[0].scrollIntoView();", target)  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="ajax-content"]/div/div[1]/form/div/div[2]/div[10]/p[1]/i').click()  #点击收费
     time.sleep(2)
     browser.current_window_handle  # 此行代码用来定位当前页面
     time.sleep(5)
     ys = WebDriverWait(browser, 20, 0.5).until(EC.presence_of_element_located((By.XPATH, '//*[@id="layui-layer43"]/div[2]/div/ul/li[2]/div[1]/i[1]')))  #
     ys.click()  #选择现金
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="layui-layer43"]/div[2]/div/ul/li[2]/div[1]/input').clear()  #
     time.sleep(2)
     browser.find_element_by_xpath('//*[@id="layui-layer43"]/div[2]/div/ul/li[2]/div[1]/input').send_keys(u"11000.00")  #
     time.sleep(3)
     browser.find_element_by_xpath('//*[@id="print_buying"]').click()  #点击确定
     time.sleep(3)
     browser.back()
Example #10
0
    def test002(self):
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[1]/a').click(
            )  # 点击预约挂号
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="registerName_input"]').send_keys(u"董焕焕")  # 输入姓名
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="appointment_nav"]/ul').click()  # 点击空白处
        browser.find_element_by_xpath('//*[@id="telephonNum"]').send_keys(
            "18611059298")  # 输入手机号
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="regis_data"]').clear()  # 选择就诊日期
        browser.find_element_by_xpath('//*[@id="regis_data"]').send_keys(tom)
        browser.find_element_by_xpath(
            '//*[@id="addRegister_save"]').click()  # 点击保存
        time.sleep(5)
        print("预约挂号成功")

        browser.find_element_by_xpath(
            '//*[@id="appointment_nav"]/ul/li[2]/a').click()  # 点击患者列表
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="appointRegis_nextDate_button"]').click()  # 点击下一天
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="querybtn"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="appointRegister_patientCart_content"]/tr[1]/td[11]/a'
        ).click()  # 点击改约
        time.sleep(3)
        browser.find_element_by_xpath('//*[@id="regis_data"]').clear()  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="regis_data"]').send_keys(
            now)  # 预约日期处输入今天的时间
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="presprint_1"]').click()  # 点击保存并打印
        time.sleep(2)
        browser.back()
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="appointment_nav"]/ul/li[2]/a').click()  # 点击患者列表
        time.sleep(2)

        browser.find_element_by_xpath(
            '//*[@id="select2-plistSearchByDocter-container"]').click()  # 点击全部
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"董焕焕")  # 输入董焕焕
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                Keys.ENTER)  # 选择董焕焕医生
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="querybtn"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="select2-plistSearchByDocter-container"]').click(
            )  # 点击医生筛选
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u'全部')  # 点击
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(Keys.ENTER)  #选择全部
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="searchPatint"]').send_keys(
            u"董焕焕")  # 搜索框中输入董焕焕
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="querybtn"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="searchPatint"]').clear()  # 搜索框中输入董焕焕
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="querybtn"]').click()  # 点击查询
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="appointRegis_cart_tab"]/li[1]').click()  # 点击已预约
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="appointRegister_patientCart_content"]/tr/td[11]/p[1]'
        ).click()  # 点击签到
        time.sleep(5)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[2]/a').click(
            )  # 点击医生工作台
        time.sleep(5)
        browser.find_element_by_xpath(
            '//*[@id="doctor_patient_cart_content"]/div[1]/div[2]/span[1]'
        ).click()  # 点击接诊
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="seeDoctoring_nav"]/ul/li[2]/a').click()  #点击检验项目
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="select2-inspectSearchInput-container"]').click(
            )  # 点击检验项目处的请选择
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                u"过敏原检测(食物组)")  #输入过敏原检测(食物组)
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                Keys.ENTER)  #选择过敏原检测(食物组)
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="select2-inspectSearchInput-container"]').click(
            )  # 点击检验项目处的请选择
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"ABO血型")  #输入ABO血型
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                Keys.ENTER)  #选择ABO血型
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="inspect_save"]').click()  # 点击保存
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="inspect_presprint"]').click()  #点击打印
        time.sleep(2)
        browser.back()  #点击返回
        time.sleep(2)
        print("填写检验项目成功")

        # 接诊界面填写检查项目
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="seeDoctoring_nav"]/ul/li[3]/a').click()  # 点击检查项目
        time.sleep(3)
        browser.find_element_by_xpath(
            '//*[@id="checkoutBox"]/div[1]/div/span[2]/span[1]/span').click(
            )  # 点击检查项目处的请选择
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                u"多普勒听胎心")  #输入多普勒听胎心
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                Keys.ENTER)  #选择多普勒听胎心
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="select2-checkoutSearchLis-container"]').click(
            )  # 点击检查项目处的请选择
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(u"泌尿系超声")  #输入泌尿系超声
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/span/span/span[1]/input').send_keys(
                Keys.ENTER)  #选择泌尿系超声
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="saveCheckoutItems"]').click()  # 点击保存
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="checkoutPresprint"]').click()  #点击打印
        time.sleep(2)
        browser.back()  #浏览器返回
        time.sleep(2)
        print("填写检查项目成功")

        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div[1]/div[2]/p[2]/a').click()  # 点击结束就诊
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="offMadicalMess"]/div/a/button').click()  # 点击是
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[7]/a').click(
            )  # 点击收费/发药
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="content"]/div[1]/div/div/ul/li[2]/a').click()  #点击收费
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="ajax-content"]/div/div[1]/div[2]/ul/li/div/div[2]'
        ).click()  #点击待收费
        time.sleep(2)
        target = browser.find_element_by_xpath(
            '//*[@id="buying_credit"]')  # 滑动到代收付页面最底部
        browser.execute_script("arguments[0].scrollIntoView();",
                               target)  # 滑动到代收付页面最底部
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="buying_credit"]').click()  # 点击挂账
        time.sleep(3)
        browser.back()

        #快速接诊
        time.sleep(2)
        browser.find_element_by_xpath(
            '/html/body/div[3]/aside/section/ul/li[2]/ul/li[2]/a').click(
            )  #点击医生工作台
        time.sleep(2)
        browser.find_element_by_xpath(
            '//*[@id="fasterLookDoctorBtn"]').click()  #点击快速接诊
        time.sleep(3)
        browser.current_window_handle  # 此行代码用来定位当前页面
        time.sleep(3)
        browser.find_element_by_id("registerName_input").send_keys(u"快速接诊")
        time.sleep(1)
        browser.find_element_by_xpath(
            '//*[@id="fasterRigis_form"]/div[6]/div[1]/span').click()  #点击空白
        browser.find_element_by_id("telephonNum").click()
        browser.find_element_by_id("telephonNum").clear()
        browser.find_element_by_id("telephonNum").send_keys("18611059298")
        time.sleep(1)
        browser.find_element_by_id("sexWoman").click()
        time.sleep(1)
        browser.find_element_by_id("registAgeInput").clear()
        browser.find_element_by_id("registAgeInput").send_keys("20")
        time.sleep(1)
        browser.find_element_by_id("fasterDo").click()
        time.sleep(2)
Example #11
0
    def test002(self):
        time.sleep(2)
        browser.find_element_by_xpath('/html/body/div[3]/aside/section/ul/li[2]/ul/li[8]/a').click()  # 点击模板管理
        # 处方模板
        browser.find_element_by_link_text(u"处方模板").click()  # 点击处方模板
        time.sleep(2)
        browser.find_element_by_id("remove_cf_btn").click()  # 点击删除
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector("button.sure_ok_1").click()  # 点击确定
        time.sleep(1)
        browser.find_element_by_id("newly_temp_cf").click()  # 点击新建处方模板
        time.sleep(1)
        browser.find_element_by_css_selector("input.temp_name_info").clear()  # 清除模板名称输入框
        time.sleep(1)
        browser.find_element_by_css_selector("input.temp_name_info").send_keys(u"新建处方模板")  # 输入新建模板名称
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr/td[2]/input').send_keys(u"阿莫西林胶囊")  # 输入阿莫西林胶囊
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="170712201200147"]').click()  # 选择阿莫西林胶囊
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr/td[3]/select').click()  # 点击用法
        time.sleep(1)
        InputType = Select(browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr/td[3]/select'))  # 选择用法
        InputType.select_by_value("10")  # 选择用法“冲服”
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="frequency_drug"]').click()  # 点击用药频次
        time.sleep(1)
        InputType = Select(browser.find_element_by_xpath('//*[@id="frequency_drug"]'))  # 选择用药频次
        InputType.select_by_value("100000000002")  # 选择用法“每天三次”
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr/td[5]/input').clear()
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr/td[5]/input').send_keys(5)  # 输入单次计量
        time.sleep(1)
        browser.find_element_by_css_selector("#cf_temp_tbody_list > tr > td:nth-child(6) > input").clear()
        browser.find_element_by_css_selector("#cf_temp_tbody_list > tr > td:nth-child(6) > input").send_keys(4)  # 输入天数
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr/td[7]/input').clear()  #
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr/td[7]/input').send_keys("2")  # 输入开药量
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="add_drug_trs"]').click()  # 点击添加药品
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr[2]/td[2]/input').send_keys(u"达克宁")  # 输入达克宁
        time.sleep(5)
        browser.find_element_by_xpath('//*[@id="170712201200245"]').click()  # 选择达克宁
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="cf_temp_tbody_list"]/tr[2]/td[6]/input').send_keys(3)  # 输入天数
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="cf_keep_btn_1"]').click()  # 点击保存
        time.sleep(2)
        browser.find_element_by_id("remove_cf_btn").click()  # 点击删除
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector("button.sure_ok_1").click()  # 点击确定
        time.sleep(1)

        # 中药处方模板
        browser.find_element_by_link_text(u"中草药处方模板").click()  # 点击中药处方模板
        time.sleep(1)
        browser.find_element_by_id("remove_btn").click()  # 点击删除
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector("button.sure_ok_1").click()  # 点击确认
        time.sleep(1)

        browser.find_element_by_id("newly_temp_zy").click()  # 点击新增 中药处方模板
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="zyForm"]/div/div[1]/span/input').send_keys(u"新增草药处方模板")  # 输入中药 处方模板名称
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="MedicineBody"]/tr/td[1]/input').send_keys(u"红花")  # 输入红花
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="medicine_tbody_info"]/tr[1]/td[1]').click()  # 选择红花
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="MedicineBody"]/tr/td[2]/input').clear()  #
        browser.find_element_by_xpath('//*[@id="MedicineBody"]/tr/td[2]/input').send_keys(u"20")  # 红花20g
        browser.find_element_by_xpath('//*[@id="usagelist"]').click()
        time.sleep(2)
        InputType = Select(browser.find_element_by_xpath('//*[@id="usagelist"]'))  # 选择用法
        InputType.select_by_value("8")  # 选择用法“泡服”
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="AddMedicineBtn"]').click()  # 点击添加药品
        time.sleep(1)
        browser.find_element_by_xpath("(//input[@type='text'])[8]").send_keys(u"土白芍")
        browser.find_element_by_xpath("(//input[@type='text'])[9]").send_keys("20")
        time.sleep(3)
        browser.find_element_by_xpath("(//tbody[@id='medicine_tbody_info']/tr/td)[7]").click()
        time.sleep(2)
        browser.find_element_by_css_selector("input.numM").send_keys("7")  # 输入剂数
        time.sleep(2)
        target = browser.find_element_by_xpath('//*[@id="keep_btn_1"]')  # 滑动到代收付页面最底部
        browser.execute_script("arguments[0].scrollIntoView();", target)  # 滑动到代收付页面最底部
        time.sleep(2)
        browser.find_element_by_css_selector("textarea.textremark").send_keys(u"饭后服用")  # 填写备注
        time.sleep(2)
        browser.find_element_by_id("keep_btn_1").click()  # 点击保存
        time.sleep(2)
        browser.find_element_by_id("remove_btn").click()  # 点击删除
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector("button.sure_ok_1").click()  # 点击确认
        time.sleep(1)


        #病例模板
        browser.find_element_by_xpath('//*[@id="clinic_templet"]/ul/li[1]/a').click()
        time.sleep(2)
        browser.find_element_by_css_selector("i.btn.delete_temp").click()  # 点击病例末班删除
        time.sleep(3)
        browser.current_window_handle
        time.sleep(3)
        browser.find_element_by_css_selector("button.sure_ok").click()  # 点击确定
        time.sleep(3)
        browser.refresh()
        time.sleep(3)
        browser.find_element_by_xpath('//*[@id="newly_temp"]').click()  # 点击新建病例模板
        time.sleep(3)
        browser.find_element_by_xpath('//*[@id="templet_form1"]/ul/li[1]/span').send_keys(u"病例模板")  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="templet_form1"]/ul/li[2]/span').send_keys(u"主诉:感冒、发烧、头疼")  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="templet_form1"]/ul/li[3]/span').send_keys(u"现病史:高血压")  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="templet_form1"]/ul/li[4]/span').send_keys(u"既往史:糖尿病")  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="templet_form1"]/ul/li[5]/span').send_keys(u"个人史:高血压、糖尿病")  #
        time.sleep(1)
        browser.find_element_by_xpath('//*[@id="templet_form1"]/ul/li[6]/span').send_keys(u"过敏史:花粉过敏")  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="templet_form1"]/ul/li[7]/span').send_keys(u"家族史:高血压")  #
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="advice_Btn_s1"]').click()  # 点击保存
        time.sleep(2)
        browser.find_element_by_css_selector("i.btn.delete_temp").click()  # 点击病例末班删除
        time.sleep(3)
        browser.current_window_handle
        time.sleep(3)
        browser.find_element_by_css_selector("button.sure_ok").click()  # 点击确定
        time.sleep(1)

        # 处理意见模板
        browser.find_element_by_link_text(u"处理意见模板").click()  # 点击处理意见
        time.sleep(1)
        browser.find_element_by_link_text(u"删除").click()  # 点击删除
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector("button.sure_ok_1").click()  # 点击确定
        time.sleep(1)
        browser.find_element_by_id("templet_btn").click()  # 点击新建处理意见
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector("li > input[type=\"text\"]").clear()  # 清除处理意见名称
        browser.find_element_by_css_selector("li > input[type=\"text\"]").send_keys(u"处理意见模板")  # 输入处理意见名称
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="layui-layer5"]/div[2]/div/ul/li[2]/input').send_keys(u"好好休息")  # 输入处理意见内容
        time.sleep(2)
        browser.find_element_by_xpath('//*[@id="btn_tip"]/button').click()  # 点击保存
        time.sleep(2)
        browser.find_element_by_link_text(u"删除").click()  # 点击删除
        time.sleep(2)
        browser.current_window_handle
        time.sleep(2)
        browser.find_element_by_css_selector("button.sure_ok_1").click()  # 点击确定
        time.sleep(1)