Compare GUi with RobotFramework
Project description
WatchUI
Basic Info
Custom library for comparing images with use in Robot Framework.
What is here?
- Test robot/test.robot - file with examples how to use keywords
- WatchUI/WatchUI.py - file with keywords
What you need
Pip install
- Open CMD
- Start
pip install WatchUI
- Now you can download WatchUI.py from repository or import WatchUI to new python file more here
- If you download WatchUI.py: You must first enter the path in Settings =>
Library path
, where path is the path to the WatchUI.py file
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/WatchUI.py)
- Enter the path in Settings =>
Library path
, where path is the path to the WatchUI.py file - Now you can start using keywords listed below. Keep in mind that you need to have all dependencies installed.
Description Keyword
Images must have same resolution!!!!
- In folder Robot framework you can find some example
- You can settings two main value in import (
Library <path to WathUI>
) - Applies to all TCs where it is not set directly at the key that the argument takes a different value
Arguments | Documentation |
---|---|
outputs_folder= | The path where you want to save the image with the highlighted differences. Default folder is ../Outputs. Adjusting the Keywords has more weight than adjusting in import |
ssim_basic= | The lowest limit of difference between images when an RF gives you a pass. Takes values from 1.0E-12 to 1.0. Default ssim is 1.0 (100%) |
Example: Library WatchUI.py outputs_folder=../Myfolder ssim_basic=0.865
Keyword | Arguments | Documentation |
---|---|---|
Compare images | path1, path2, save_folder=, ssim= |
This compares two images. If there are differences it saves an image with the differences highlighted into the folder.path1 = path to the first image to be compared path2 = path to the second image to be compared Example: |
Compare screen | path1, save_folder=, ssim= |
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_folder 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. Default folder is ../Outputs ssim= The lowest limit of difference between images when an RF gives you a pass. Takes values from 1.0E-12 to 1.0. Default ssim is 1.0 (100%) Example: Compare screen ../image1.png |
Create area | x1, y1, x2, y2, screen_name=, 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 screen areas | x1, y1, x2, y2, path1, save_folder=, ssim= |
Compares 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 region x2 and y2 = x and y coordinates for the bottom right corner of the region Compare screen areas 0 0 25 25 ../Crop_Image1.png |
Compare screen without areas | path1 *args, save_folder=, ssim= |
Compares pictures (screenshot and image file) with areas to be ignored x1 and y1 = x and y coordinates for the upper left corner of the area to be ignored x2 and y2 = 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 ... Example:Compare screen without areas ../Image1.png 0 0 30 40 50 50 100 100 Creates 2 ignored parts at 0,0, 30,40 and 50, 50, 100, 100 |
Create screens | *resolution save_folder= screen_name= |
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_screens *resolution = The specified resolution in width and height format, you can enter as many as needed save_folder= path where you want to save the image with the highlighted differences. Default folder is ../Create_screens screen_name= the path where you want to save the image with the highlighted differences. Default name is (it is not mandatory to set it up) 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=, ssim= |
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 Default folder is ../Outputs folder_csv= folder for csv file with save coordinates. Default folder is ../CSV_ERROR ssim= The lowest limit of difference between images when an RF gives you a pass. Takes values from 1.0E-12 to 1.0. Default ssim is 1.0 (100%)Example: 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 |
Sample results
Image where the differences are stored + You can see two black box in left corner. These black box are ignored during comparison.
The red rectangles outlining missing elements on compared screens
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 Distribution
Built Distribution
File details
Details for the file WatchUI-0.17.2.tar.gz
.
File metadata
- Download URL: WatchUI-0.17.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- 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 | cc29ba79be7565235a92017d4494e64541eb420165fd35b0a1a165671872f668 |
|
MD5 | 36931e86feefae1f9d35d7e0ebb4e5af |
|
BLAKE2b-256 | 7b5c2f03039c0c5e05a3df20a96cdb749258a3c36525fee99e530209750f9625 |
Provenance
File details
Details for the file WatchUI-0.17.2-py3-none-any.whl
.
File metadata
- Download URL: WatchUI-0.17.2-py3-none-any.whl
- Upload date:
- Size: 8.5 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 | 50bb13a3f87954d8f5b6e959dbe4fb366011576c34e48a88f0e039b33fabec84 |
|
MD5 | 0f652690d896c97e1b22d5116aab2fa7 |
|
BLAKE2b-256 | c3430f5f691be460118b3b674192d6ce8d141466bb17ce1bd72d4af108fd8bc2 |