Score
0
Watch 12 Star 27 Fork 2

泰斯特 / Pic-Diff-RecognizerPythonAGPL-3.0

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
基于图像差异识别与页面遍历探索的 Selenium UI自动化测试插件库 spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Pic-Diff-Recognizer

Selenium plugin library based on image difference recognition and page intelligent exploration.

installation

pip install -r requirements.txt

pip install pic-diff-recognizer

best practice

from pic_diff_recognizer.searchHandler import SearchHandler
from violent_webdriver import Chrome
from 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 searchHandler
search_handler = SearchHandler(browser=dr)

# search and saving baseline images in current directory named baseline
search_handler.traverse_href(origin_url='https://gitbook.cn/gitchat/author/5cea0bfbb78cc870612d8bba')

# -------------------- assuming after some iterations of current project -----------------------------

search_handler.url_histories = []

# load baseline images
search_handler.picture_handler.load_base_line()

# search and comparing screen shots and baseline images
search_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 directory
search_handler.picture_handler.generate_diff_between_base_line_and_screen_shot()

# output testReport.txt to current directory
search_handler.picture_handler.export_picture_comparison_result()

contact me

email address:523314409@qq.com

Comments ( 2 )

Sign in for post a comment

Python
1
https://gitee.com/amazingTest/Pic-Diff-Recognizer.git
git@gitee.com:amazingTest/Pic-Diff-Recognizer.git
amazingTest
Pic-Diff-Recognizer
Pic-Diff-Recognizer
master

Search