Ai test Applitools use of python

A: Appltools Downloads:

pip install eyes-selenium==3.16.2

II:
Registration: Appltools account:
https://applitools.com/sign-up

Third, access: API:

New: .py file

from selenium import webdriver
from applitools.selenium import Eyes

class HelloWorld:

    global driver
    eyes = Eyes()

    # Initialize the eyes SDK and set your private API key.
    eyes.api_key = 'lxxxxxxx'

    try:

        # Open a Chrome browser.
        driver = webdriver.Chrome()

        # Start the test and set the browser's viewport size to 800x600.
        eyes.open(driver, "Hello World!", "My first Selenium Python test!", {'width': 800, 'height': 600})

        # Navigate the browser to the "hello world!" web-site.
        driver.get('https://applitools.com/helloworld')

        # Visual checkpoint #1.
        eyes.check_window('Hello!')

        # Click the 'Click me!' button.
        driver.find_element_by_css_selector('button').click()

        # Visual checkpoint #2.
        eyes.check_window('Click!')

        # End the test.
        eyes.close()

    finally:

        # Close the browser.
        driver.quit()

        # If the test was aborted before eyes.close was called, ends the test as aborted.
        eyes.abort_if_not_closed()
Run it: 
After a review of sub-run results:
https://applitools.com/users/login
below offer Applitools official website:
https://applitools.com/tutorials/
Applitools more sdk:
HTTPS: // applitools. COM / the Tutorial
Applitools document:
https://applitools.com/docs
Applitools demo:
https://applitools.com/request-demo?utm_source=tutorials
Applitools Knowledge Base:
https://help.applitools.com/hc/en -us /

Guess you like

Origin www.cnblogs.com/gufengchen/p/11594584.html