Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pic-diff-recognizer-1.0.0.tar.gz (9.8 kB view details)

Uploaded Source

File details

Details for the file pic-diff-recognizer-1.0.0.tar.gz.

File metadata

  • Download URL: pic-diff-recognizer-1.0.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

File hashes

Hashes for pic-diff-recognizer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 50fe6669c4dd3e43401f9255eea7991e0baa2b8347562e4e52400408eaef5f05
MD5 6b8049650e8e4235312a21c18b2e9193
BLAKE2b-256 fab69ccb643b092c1a34f41f755d2490d78ecc8125d78ce53c7136ea8926f030

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page