美文网首页
Selenium自动化框架控制页面

Selenium自动化框架控制页面

作者: 二十二_0cbe | 来源:发表于2019-08-21 15:16 被阅读0次
    def run(driver, url):
        try:
            driver.get(url)
            time.sleep(3)
            cls = driver.find_elements_by_xpath('//font[contains(text(),"0.00%")]')
            cls[0].click()
            time.sleep(1)
    
            line = driver.find_element_by_xpath('//div[@class="x-grid3-row-checker"]')
            ActionChains(driver).context_click(line).perform()
            time.sleep(1)
    
            add = driver.find_element_by_xpath('//span[contains(text(), "添加文件批注")]')
            add.click()
            time.sleep(1)
    
            mudol = driver.find_element_by_xpath('//textarea[contains(@name, "模块")]').send_keys('dc')
            jianyi = driver.find_element_by_xpath('//input[contains(@name, "开发分析建议")]').send_keys('无需改进')
            button_click = driver.find_element_by_xpath('//button[contains(text(), "确定")]').click()
            time.sleep(1)
            qd2 = driver.find_elements_by_xpath('//button[contains(text(), "确定")]')
            qd2[1].click()
        except Exception as e:
            print(e)
            return
    

    相关文章

      网友评论

          本文标题:Selenium自动化框架控制页面

          本文链接:https://www.haomeiwen.com/subject/djtisctx.html