Now easily compare images/logos from website under test using
Image Assertion Steps
Pass appropriate locator of “actual image” and URL of “expected images” (which you can store on some server) to following steps to compare images/logos from testing website :
Then actual image having id "(.*?)" and expected image having url "(.*?)" should be similar
Then actual image having name "(.*?)" and expected image having url "(.*?)" should be similar
Then actual image having class "(.*?)" and expected image having url "(.*?)" should be similar
Then actual image having xpath "(.*?)" and expected image having url "(.*?)" should be similar
Then actual image having css "(.*?)" and expected image having url "(.*?)" should be similar
Then actual image having url "(.*?)" and expected image having url "(.*?)" should be similar
Pass appropriate locator of “actual image” and image name of “expected images” (which you can store locally on you machine under “expected_images” folder in feature skeleton) to following steps to compare images/logos from testing website :
Then actual image having id "(.*?)" and expected image having image_name "(.*?)" should be similar
Then actual image having name "(.*?)" and expected image having image_name "(.*?)" should be similar
Then actual image having class "(.*?)" and expected image having image_name "(.*?)" should be similar
Then actual image having xpath "(.*?)" and expected image having image_name "(.*?)" should be similar
Then actual image having css "(.*?)" and expected image having image_name "(.*?)" should be similar
Then actual image having url "(.*?)" and expected image having image_name "(.*?)" should be similar
To compare two images from same webpage you can make use following steps.
Then actual image having id "(.*?)" and expected image having id "(.*?)" should be similar
Then actual image having name "(.*?)" and expected image having name "(.*?)" should be similar
Then actual image having class "(.*?)" and expected image having class "(.*?)" should be similar
Then actual image having xpath "(.*?)" and expected image having xpath "(.*?)" should be similar
Then actual image having css "(.*?)" and expected image having css "(.*?)" should be similar
Then actual image having url "(.*?)" and expected image having url "(.*?)" should be similar
- If any difference appears in actual image and expected images then difference between images will be highlighted and stored in “image_difference” directory in feature skeleton. (Note : This feature works only for PNG images.)
- You can avail “Image Assertion Steps” for gem version 1.1.1 and above.
- From gem version 1.1.1 and above feature skeleton is slightly changed. We have introduced four more directories “expected_images”, “image_difference”, “actual_images”,”screenshots” in feature skeleton.
Video tutorial about how to use image assertion steps.
for jpg how to check it ..
LikeLike
Same the way for PNG images, only it will not save the difference if any.
LikeLike