09 2020 档案
摘要:xpath定位遇到如下问题:br/>//*[ends-with(@id,"多测师")]定位不到以"多测师"结尾的元素原因如下:ends-with是xpath2.0的语法,可能你的浏览器还只支持1.0的语法 解决如下://*[ends-with(@id,"多测师")] 等价于 //input[subs
阅读全文
摘要:举个栗子 百度搜索右上角有个“百度首页”的小标签链接 html: <a class="toindex" href="/">百度首页</a> xpath为: //*[@id="u"]/a[1] 获取标签内容,也就是“百度首页“”这几个字 python: a=driver.find_element_by
阅读全文
摘要:练习:取到下方链接下所有海贼王的下载链接。 1 # coding=utf-8 2 from selenium import webdriver 3 from time import sleep 4 import keyword 5 from selenium.webdriver.common.key
阅读全文
摘要:locust性能测试界面分为New test、Statistics、Charts、Failures、Exceptions、Download Data、Top七个部分。 1、New test 点击该按钮可对模拟的总虚拟用户数和每秒启动的虚拟用户数进行编辑。Number of users to simu
阅读全文
摘要:Locust 官方网站:https://www.locust.io/ 1. Locust 介绍 An open source load testing tool.一个开源性能测试工具。define user behaviour with python code, and swarm your sys
阅读全文
摘要:最近想学习Locust性能测试,没想到卡在了安装上。根据官方指导文档,执行pip install locust,报错信息如下所示: Downloading MarkupSafe-1.1.1-cp36-cp36m-win32.whl (15 kB) Using legacy setup.py inst
阅读全文
摘要:在学习Pthyon阶段,在迭代输出列表的时候,创建成了集合对象,出现了这个BUG(在创建对象时,将()写成了{}) 以下是错误案例: #创建的集合 names = {"你大爷","你二大爷","你三大爷"} ages = {18,19,20,21} jobs = {"老师","程序员","打酱油的"
阅读全文
摘要:本节重点: ActionChains 类 context_click() 右击 double_click() 双击 drag_and_drop() 拖动 测试的产品中有一个操作是右键点击文件列表会弹出一个快捷菜单,可以方便的选择快捷菜单中的选择对文件进行操作(删除、移动、重命名),之前学习元素的点击
阅读全文
摘要:弹出框是alert类型: selenium提供switch_to_alert方法:捕获弹出对话框(可以定位alert、confirm、prompt对话框) 弹出框不是alert类型: 1、弹出框是div层,跟平常一样定位,不用管弹出框 #点击退出按钮 FindElement(self.brower,
阅读全文
摘要:1、尝试下拉一段滚动条,让按钮能看到 1 2 3 4 js = "window.scrollTo(100,450)" driver.execute_script(js) driver.find_element_by_css_selector("div.loginForm>input#loginBtn
阅读全文

浙公网安备 33010602011771号