Package for compare GUI
Project description
WatchUI
Basic Info
Custom library for comparing images with use in RobotFramework. It can be used as free functions to import into another language, but be careful because i used some command for robot framework (loggin etc.).In the future we will also create a library for python + selenium.
RF example: Library path
Python example:import robotframework.py
What is here?
- Test robot/test.robot - file with example how to use keyword
- WatchUI/robotframework.py - file with keywords
What you need
Pip install
- Open CMD
- Start
pip install WatchUI
- Import to robotframework
Library WatchUI
orLibrary WatchUI/robotframework.py
Manual Install
Main
- Python
- RobotFramework
- OpenCV
pip install opencv-python
orpip3 install opencv-python
- Pillow
pip install Pillow
- Numpy
pip install numpy
- Scikit
pip install scikit-image
- Imutils
pip install imutils
How to install in RF
- Download git file (Mainly ./Python/robotframework.py)
- You must first enter the path in Settings =>
Library path
, where path is the path to the robotframework.py file - Now, you can start using keywords listed below. Keep in mind that you need to have everything installed in order for it to work properly
Description Keyword
It is always necessary to ensure that the images are the same resolution (size) !!!!
- In folder Test robot you can find some example :-)
Keyword | Arguments | Documentation |
---|---|---|
Compare two image | path1, path2, save_folder= |
This compares two images from two folders. If there are differences it saves an image with the differences highlighted into the folder: ../Compare two Images path1 = path to the first image to be compared path2 = path to the second image to be compared Example: Compare two image ../image1.png ../Image2.png |
Compare screen | path1, save_folder= |
Compares a saved image with what is displayed on the screen. If there is a difference it saves an image with the differences highlighted to the: ../Save Image path1 = path to the image to be compared to screen save_folder= the path where you want to save the image with the highlighted differences. Basic settings is ../Save Image (it is not mandatory to set it up) Example: Compare screen ../image1.png |
Compare making area | x1, y1, x2, y2, save_folder= |
Creates a cut-out area of what is displayed on the screen and saves it in the folder: ../Create area x1 a y1 = x and y coordinates for the upper left corner of the square x2 and y2 = x and y coordinates for the bottom right corner of the square Example: Compare making area 0 0 25 25 |
Compare screen area | x1, y1, x2, y2, path1, save_folder= |
Compares and area of the screen with a previously created cut out image area x1 and y1 = x and y coordinates for the upper left corner of the screen area to compare x1 and y1 = x and y coordinates for the upper left corner of the square x2 and y2 = x and y coordinates for the bottom right corner of the square Creates Crop_Image1.png from 0, 0, 25, 25 |
Compare screen without areas | path1 *args, save_folder= |
Compares two pictures with areas to be ignored x1 and y1 = x and y coordinates for the upper left corner of the area to be ignored x and y coordinates for the lower right corner of the area to be ignored Attention! It is always necessary to enter in order x1 y1 x2 y2 x1 y1 x2 y2 etc ... Compare screen without areas ../Image1.png 0 0 30 40 50 50 100 100Creates 2 ignored parts at 0,0, 30,40 and 50, 50, 100, 100 |
Compare making rescreens | *resolution | Creates a screenshot of the screen with specified resolution. It is possible in one command to create an infinite number of screens with different resolutions. Screens are stored in the folder: ../Create rescreens resolutin = The specified resolution in width and height format, you can enter as many as needed Example: compare making rescreens 800 600 1280 800 1440 900 Creates 3 screens in 800x600 1280x800 and 1440x900 |
Compare screen get information | path1, save_folder=, folder_csv= |
Compares an already saved image with what is displayed on the screen. If there is a difference, it saves an image with the highlighted differences to the: ../save_folder and creates a csv file with the coordinates and elements that exist on those coordinates *path1 = path to the image to be compared *path1 = path to the image to be comparedsave_folder= path where you have save img folder_csv= folder for csv file with save coordinates. Basic settings is ../CSV_ERROR (it is not mandatory to set it upExample: compare screen get information 1c.png Compare img 1c.png with screen and save img with diff and save csv file with elements on this coordinates |
How it looks screen
Image where the differences are stored + You can see two black box in left corner. These black box are ignored in compare.
Image can u see in the log, red rectangle are mising or not existing elements on web
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file WatchUI-0.1.15-py3-none-any.whl
.
File metadata
- Download URL: WatchUI-0.1.15-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 108440d8468929f15f0b2de48993034f16ff1791f9826837ad0e0ed5b2d7f408 |
|
MD5 | cd11793d4394684c39046959c78f1af8 |
|
BLAKE2b-256 | 06eb752d9ebed97d017f4820a3272ea69cee640194da89ad83a194ed1a14b458 |