Closed lovelyplanet2019 closed 2 years ago
Hi, there are different ways how to ignore parts. One very simple way, is by using an area mask. You can basically say: Ignore the top 10 % of the image. Or the left 5% of the image. That's a very simple way to ignore parts.
Check out the example here for Compare two different PDF Files with area mask
https://github.com/manykarim/robotframework-doctestlibrary/blob/main/atest/Compare.robot
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_changed.pdf placeholder_file=testdata/pdf_area_mask.json
The mask file looks like that:
[ { "page": "all", "name": "Job ID", "type": "area", "location": "top", "percent": 10 } ]
You will also find some explanatio here https://github.com/manykarim/robotframework-doctestlibrary#different-mask-types-to-ignore-parts-when-comparing
It is also mentioned in the video (roughly from this position) https://youtu.be/qmpwlQoJ-nE?t=377
thanks I got it by simply use
[
{
"page": "all",
"type": "area",
"location": "top",
"percent": 15
},
{
"page": "all",
"type": "area",
"location": "left",
"percent": 15
},
{
"page": "all",
"type": "area",
"location": "right",
"percent": 15
},
{
"page": "all",
"type": "area",
"location": "bottom",
"percent": 15
}
]
Cool, happy that this solved your problem :)
Basically, I just want to compare the content within the webpage, the browser border/windows date time/taskbar isn't concern.
How do I set robot to ignore them?