摘要: from PIL import Imageimport mathimport operatorfrom functools import reducedef compare(pic1,pic2): ''' :param pic1: 图片1路径 :param pic2: 图片2路径 :return: 阅读全文
posted @ 2019-08-17 11:02 Be_your_own_hero 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1:查看当前微信正在运行的微信公众号进程 C:\Users\edz>adb shell dumpsys activity top | findstr ACTIVITY ACTIVITY com.netease.cloudmusic/.activity.LockScreenActivity cb444 阅读全文
posted @ 2019-08-13 14:09 Be_your_own_hero 阅读(981) 评论(0) 推荐(0) 编辑
摘要: from common.logger import Logger logger=Logger().get_logger() class BasePage: def __init__(self,driver): self.driver=driver def get_window_size(self): logger.info("正在准备获取当前屏幕的... 阅读全文
posted @ 2019-08-13 13:07 Be_your_own_hero 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 获取日志保存的路径 日志封装,当然我这里没有写日志移除,还需要完善 阅读全文
posted @ 2019-08-13 11:12 Be_your_own_hero 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 1:android的resource-id 属性 driver.find_element_by_id("resource-id 值") 2:android的class属性 driver.find_element_by_class_name("class属性值") 3:android的content- 阅读全文
posted @ 2019-08-12 16:07 Be_your_own_hero 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 在做web自动化的时候,我碰到一些input 类型的radio (单选框),虽然也是联动的,但是我无法根据页面元素判断选中和非选中,也无法通过is_selected()方法判断,所以想到用元素截屏后对比两张图片是否一样。 附上元素截屏代码: 附上两张图片对比代码(需要安装第三方模块openc): 阅读全文
posted @ 2019-08-08 17:54 Be_your_own_hero 阅读(203) 评论(0) 推荐(0) 编辑
摘要: * now() (返回当前系统日期和时间) *curdate() (返回当前系统日期不包括时间) *curtime() 只返回时间 *year() 返回年 month() 返回月 day() 返回天 select year("1998-9-8") 1998 select month("1998-9- 阅读全文
posted @ 2019-08-07 23:04 Be_your_own_hero 阅读(137) 评论(0) 推荐(0) 编辑
摘要: *round(四舍五入) select round(1.34) 1 select round(1.9) 2 select round(1.234,2) 1.23 select round(1.457,2) 1.46 *ceil(向上取整) select ceil(1.34) 2 select cei 阅读全文
posted @ 2019-08-07 22:14 Be_your_own_hero 阅读(123) 评论(0) 推荐(0) 编辑
摘要: *单行函数 *length(获取字节个数) select length("join") 返回4 *concat(拼接) select concat("firstname","_","last_name"); firstname_last_name *upper(将所有字母变大写) select up 阅读全文
posted @ 2019-08-07 22:02 Be_your_own_hero 阅读(164) 评论(0) 推荐(0) 编辑
摘要: ele=driver.find_elements_by_xpath("//img[@src='/Public/Home/Default/images/shanchu.png']")[0] #获取元素属性 print(ele.get_attribute("src")) #修改元素属性 driver.execute_script("arguments[0].setAttribute(argument... 阅读全文
posted @ 2019-08-07 16:44 Be_your_own_hero 阅读(859) 评论(0) 推荐(0) 编辑