随笔分类 - selenium
摘要:https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/ docker run -p 6080:80 -v /dev/shm:/dev/shm dorowu/ubuntu-desktop-lxde-vnc 在web端访问虚拟机实现 seleni
阅读全文
摘要:https://mp.weixin.qq.com/s/oUFF1_0ygwEyY8X-cg6g0Q 看到这个,大家应该也毕竟熟悉了,其实就是Docker的NoVnc的镜像,图形界面化docker环境,用浏览器直接打开就可以看到桌面,还可以直接操作,与一个普通界面操作系统基本无差,估计看到这里大家百度
阅读全文
摘要:https://www.cnblogs.com/hhaostudy/p/16121859.html pip install selenium-wire import time from seleniumwire import webdriver # Create a new instance of
阅读全文
摘要:参考: https://www.imooc.com/article/31609 https://blog.csdn.net/lb245557472/article/details/91966770 (3种方法实现) grid官网下载 https://www.selenium.dev/download
阅读全文
摘要:from selenium import webdriver from selenium.webdriver.common.keys import Keys import time driver = webdriver.Chrome() driver.get("http://www.baidu.co
阅读全文
摘要:从页面上可以看出 html结构 为 ul标签下的li标签 全局查找ul标签下的元素 document.querySelectorAll('ul') document.querySelectorAll('ul')[2]['children'][0] 就是下拉框的test 那么selenium执行js操
阅读全文
摘要:https://www.bilibili.com/read/cv10519533/ https://www.cnblogs.com/duoba/p/14297802.html 环境1分钟就装好了 还不用考虑驱动浏览器版本啥的 网上有个人的徒弟写的到时看下 https://www.cnblogs.co
阅读全文
摘要:Selenoid 可以在机器上跑自动化然后在web端上看到效果 https://www.jianshu.com/p/29c7240e9f48 (这篇比较详细) https://blog.csdn.net/weixin_44149181/article/details/120214359 https:
阅读全文
摘要:https://segmentfault.com/a/1190000017048240 https://blog.csdn.net/weixin_30491641/article/details/95030478 https://www.jianshu.com/p/e778255e8d23 队列和栈
阅读全文
摘要:相信大家在使用selenium做网页自动化时,会遇到如下这样的一个场景: 在你使用get访问某一个网址时,会在页面中弹出如上图所示的弹出框。 首先想到是利用Alert类来处理它。 然而,很不幸,Alert类处理的结果就是没有结果,并不能够将这个弹出框关闭掉。 无法用处理alert的方式来关闭该弹出框
阅读全文
摘要:xpath可以以标签定位,也可以@任意属性: 如:以input标签定位:driver.find_element_by_xpath("//input[@id='kw']") 如:@type属性:driver.find_elements_by_xpath("//input[@type='text']")
阅读全文
摘要:近期有同学在做web自动化的时候,发现页面上有些元素,在selenium中无法通过xpath来定位,各种原因找了半天,都没找到解决方案。 最后发现元素在一个叫做shadow-root的节点下面。 如下所示: 问题:shadow-root是什么?为什么下面的节点在selenium无法通过xapth来定
阅读全文
摘要:js="document.getElementsByClassName('CodeMirror-line')[0].innerHTML = 'xxxxxx'"dr.execute_script(js) 原来 插入后 xxxx 也可以换成其他一连串标签
阅读全文
摘要:例子: 设置无界面模式浏览器启动 chrome_options = webdriver.ChromeOptions() chrome_options.add_argument('--headless') driver = webdriver.Chrome(chrome_options=chrome_
阅读全文
摘要:python历史版本下载 https://pypi.org/project/selenium/#history java历史版本下载 http://selenium-release.storage.googleapis.com/index.html 官网 https://www.seleniumhq
阅读全文
摘要:1.如果要使用并发执行测试用例,那么除了并发的测试用例文件 为一个类 ,其余被调用的文件都不要类,不然 在总执行文件中获取类里面的测试用例时会失败 这个方法,调用的测试用例的文件 import 的模块 里面不能有类,不然会获取不到测试用例 2.给每个文件加类,不用并发,可执行成功,配合jenkins
阅读全文
摘要:common目录 定义了通用的异常类 webdriver目录 android、backberry、chrome、edge、firefox、ie、opera、phantomjs、safari、 webkitgtk为不同模式的浏览器的支持 common为通用的一些定义 support为一些辅助支持功能
阅读全文
摘要:1.脚本里调用其他类里面的方法 需要把脚本里面的self.dr 传到其他类里面,其他类里面要先初始化这个self.dr 变成自己类里面的 脚本里面的dr是 appium启动的代码 dr= webdriver.Remote('http://127.0.0.1:4723/wd/hub',desired_
阅读全文
摘要:https://www.seleniumhq.org/download/ Firefox驱动文件版本下载地址,请点击https://github.com/mozilla/geckodriver/releases。
阅读全文

浙公网安备 33010602011771号