随笔分类 -  python UI自动化

摘要:前言:在工作和学习selenium自动化过程中记录学习知识点,深化知识点 1. 设置元素等待 元素定位之元素等待-- WebDriver提供了两种类型的等待:显示等待和隐式等待。 1.1 显示等待 显式等待使WebDriver等待某个条件处理时继续执行,否则在达到最大时长时抛弃超时异常(Timeou 阅读全文
posted @ 2022-09-13 17:14 一颗卷心菜QAQ 阅读(514) 评论(0) 推荐(0) 编辑
摘要:方法一: 增加强制等待时间 方法二: 使用js点击 element = self.browser.find_element(By.XPATH, "//td[@class='el-table_1_column_11 is-hidden']//span[text()=' 保存 ']")self.brow 阅读全文
posted @ 2022-09-13 15:38 一颗卷心菜QAQ 阅读(161) 评论(0) 推荐(0) 编辑
摘要:1、异常原因 在编写ui自动化时,执行报错元素无法点击:ElementClickInterceptedException 具体报错:selenium.common.exceptions.ElementClickInterceptedException: Message: element click 阅读全文
posted @ 2022-09-02 17:10 一颗卷心菜QAQ 阅读(3608) 评论(0) 推荐(1) 编辑
摘要:1、异常原因 执行调试报错:selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page documen 阅读全文
posted @ 2022-08-17 16:06 一颗卷心菜QAQ 阅读(1164) 评论(0) 推荐(0) 编辑
摘要:selenium之八大元素定位: 1、通过ID的方式定位 id是页面的唯一标识 例如:找到百度的搜索输入框 driver.findElement(By.id("kw")) 2、通过tagName的方式定位 用标签名定位非常少 一般会重复driver.findElements(By.tagName(" 阅读全文
posted @ 2022-08-12 15:15 一颗卷心菜QAQ 阅读(439) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示