随笔分类 -  Selenium

selenium复用浏览器
摘要:参考网址: https://www.cnblogs.com/creamk87/p/13532071.html https://www.cnblogs.com/creamk87/p/13532119.html 阅读全文

posted @ 2021-06-24 14:42 crystal1126 阅读(34) 评论(0) 推荐(0)

selenium面试题
摘要:1、selenium中如何判断元素是否存在 匹配元素列表,如果列表为空,则元素不存在,反之,元素存在2、selenium中如何保证操作成功率 添加元素等待 有时候会发生代码运行,一会成功,一会失败,但是debug每次都能运行成功,加个sleep 使用 try 的方式,尝试不同的定位手段,id,nam 阅读全文

posted @ 2020-11-26 11:43 crystal1126 阅读(290) 评论(0) 推荐(0)

selenium疑难杂症
摘要:1、input输入框无法清空 https://blog.csdn.net/weixin_45081575/article/details/106957533 阅读全文

posted @ 2020-08-31 15:14 crystal1126 阅读(153) 评论(0) 推荐(0)

linux中配置selenium运行环境及selenium无界面运行
摘要:一、在linux中使用selenium 1、安装chrome 用下面的命令安装Google Chrome yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm 也可以先下载至本地, 阅读全文

posted @ 2020-07-07 10:10 crystal1126 阅读(1564) 评论(0) 推荐(0)

selenium常见用法
摘要:1、打开和关闭浏览器  打开浏览器 driver=webdriver.Ie() driver=webdriver.Chrome() driver=webdriver.Firefox()关闭浏览器 driver.close() 关闭浏览器以及浏览器驱动程序 driver.quit() 2、打开 阅读全文

posted @ 2020-05-08 13:29 crystal1126 阅读(329) 评论(0) 推荐(0)

Xpath语法
摘要:文章内容摘录自:https://www.w3school.com.cn/xpath/xpath_syntax.asp 1、Xpath语法 实例: 1) 选取节点 语法: 实例: 2)谓语 实例: 3)选取未知节点 语法: 实例: 4)选取若干路径 2、xpath运算符 阅读全文

posted @ 2020-04-30 10:46 crystal1126 阅读(138) 评论(0) 推荐(0)

selenium上传文件方法汇总
摘要:参考以下博客: https://blog.csdn.net/huilan_same/article/details/52439546 https://blog.csdn.net/qq_32897143/article/details/82112364 https://blog.csdn.net/qq 阅读全文

posted @ 2020-03-18 18:13 crystal1126 阅读(130) 评论(0) 推荐(0)

随笔-记录一些简单内容
摘要:Chrome浏览器驱动地址 https://chromedriver.storage.googleapis.com/index.html 阅读全文

posted @ 2020-02-11 10:19 crystal1126 阅读(110) 评论(0) 推荐(0)

PO模式代码结构
摘要:web自动化用到的项目设计模式最成熟的就是pageobject设计模式,简称PO模式。 1、框架元素 主要分为三层: case:用例层封装:test_xx.py针对每个页面写测试用例 case/conftest.py:局部的配置文件,只在case目录下生效,可以写一些用例的准备工作,如:登录 com 阅读全文

posted @ 2020-01-19 15:14 crystal1126 阅读(732) 评论(0) 推荐(0)

Selenium元素定位的几种方式
摘要:一、通过id查找 例:<input id="kw" name="wd" class="s_ipt" value="" maxlength="255" autocomplete="off"> element = driver.find_element_by_id("kw") 二、通过name查找 例: 阅读全文

posted @ 2019-09-22 21:26 crystal1126 阅读(1623) 评论(0) 推荐(0)

导航