• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Pic-Diff-Recognizer: 基于图像差异识别与页面遍历探索的 Selenium UI自动化测试插件 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

Pic-Diff-Recognizer

输入图片说明

基于图像差异识别与页面遍历探索的 Selenium UI 自动化测试插件库。

此库诞生的起源是为了让 UI 自动化测试不再需要与页面元素打交道, 而是直接使用真实的视觉差异来判断测试结果是否符合预期。

相关介绍文章

安装

pip install -r requirements.txtpip install pic-diff-recognizer

最佳实践

from pic_diff_recognizer.searchHandler import SearchHandlerfrom violent_webdriver import Chromefrom selenium.webdriver.chrome.options import Options# add some useful options :)chrome_options = Options()chrome_options.add_argument("--headless")chrome_options.add_argument("disable-infobars")chrome_options.add_experimental_option("excludeSwitches", ['enable-automation'])# init driver , executable_path should be your own path!dr = Chrome.violent_chromedriver(chrome_options=chrome_options,                                 executable_path='/usr/local/bin/chromedriver')# init searchHandlersearch_handler = SearchHandler(browser=dr)# search and saving baseline images in current directory named baselinesearch_handler.traverse_href(origin_url='https://gitbook.cn/gitchat/author/5cea0bfbb78cc870612d8bba')# -------------------- assuming after some iterations of current project -----------------------------search_handler.url_histories = []# load baseline imagessearch_handler.picture_handler.load_base_line()# search and comparing screen shots and baseline imagessearch_handler.traverse_href(origin_url='https://gitbook.cn/gitchat/author/5cea0bfbb78cc870612d8bba',                             compare_baseline_and_screen_shots=True)# generate_diff_between_base_line_and_screen_shot and output diffResults to current directorysearch_handler.picture_handler.generate_diff_between_base_line_and_screen_shot()# output testReport.txt to current directorysearch_handler.picture_handler.export_picture_comparison_result()

联系我

输入图片说明


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap