会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Luafair
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2018年12月7日
图片上传报错“unknown error: cannot focus element”
摘要: 今天写自动化脚本一直报错,图片上传一直无法定位到元素,百度查才发现图片上传div没有input控件,只能借助工具(autoit ),这个百度很多案例(http://www.bubuko.com/infodetail-2547362.html)
阅读全文
posted @ 2018-12-07 16:30 Luafair
阅读(678)
评论(0)
推荐(0)
2018年11月29日
selenium unittest提示“no tests were found”
摘要: 今天测试一个查询,遇到no tests were found提示,原来是方法名称不能Test大写,感谢天枢的博客
阅读全文
posted @ 2018-11-29 11:22 Luafair
阅读(411)
评论(0)
推荐(0)
2018年11月27日
PageObject设计模式
摘要: 对界面元素和功能模块进行封装,减少代码冗余。 登录案例 新建BasePage.py文件
阅读全文
posted @ 2018-11-27 11:17 Luafair
阅读(334)
评论(0)
推荐(0)
2018年11月22日
爬取网页瀑布流图片
摘要: import requestsfrom urllib import requesturl = "https://image.baidu.com/search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&is=&fp=result&queryWord=%E
阅读全文
posted @ 2018-11-22 17:08 Luafair
阅读(630)
评论(0)
推荐(0)
发送邮件(多人)
摘要: #SMTP:简单邮件传输协议,属于TCP/IP协议#smtplib模块,发送邮件#email模块,负责构造邮件import smtplib #发送邮件模块from email.mime.text import MIMEText #定义邮件内容from email.header import Head
阅读全文
posted @ 2018-11-22 10:28 Luafair
阅读(1143)
评论(0)
推荐(0)
2018年11月21日
最简单的网页截图
摘要: 截图的过程中遇到一些问题,如果没有进行转义,程序既不会报错但也不会截图成功from selenium import webdriverfrom time import sleep,ctimedriver=webdriver.Chrome()driver.get("https://www.hao123
阅读全文
posted @ 2018-11-21 11:12 Luafair
阅读(319)
评论(0)
推荐(0)
iframe嵌套定位
摘要: from selenium import webdriverdriver=webdriver.Chrome()file_path=r"D:\PychramProjects\lyttest\Test\Frame.html"driver.get(file_path)driver.switch_to.fr
阅读全文
posted @ 2018-11-21 11:07 Luafair
阅读(380)
评论(0)
推荐(0)
键盘操作
摘要: #键盘操作from selenium.webdriver.common.keys import Keysfrom selenium import webdriverfrom time import sleepdriver=webdriver.Chrome()driver.get("http://ww
阅读全文
posted @ 2018-11-21 11:05 Luafair
阅读(617)
评论(0)
推荐(0)
鼠标操作
摘要: from selenium import webdriverfrom selenium.webdriver import ActionChainsimport timedriver=webdriver.Chrome()driver.get("http://www.baidu.com")driver.
阅读全文
posted @ 2018-11-21 11:04 Luafair
阅读(669)
评论(0)
推荐(0)
定位下拉框,这里遇到一些问题,没有添加显式等待会导致找不到页面元素,折腾了一会儿
摘要: from selenium.webdriver import ActionChainsdriver.get("http://baidu.com")link=driver.find_element_by_link_text('设置')ActionChains(driver).move_to_eleme
阅读全文
posted @ 2018-11-21 11:02 Luafair
阅读(310)
评论(0)
推荐(0)
1
2
下一页
公告