Scrolling question as VisualAssert Requires image area to be in view

I’m using visualAssert to verify several key elements on a webpage. If I want to test things at the top I run “storeEval | window.scroll(0,0)” and then check the header elements. Before I can visualAssert elements below-the-fold I need to scroll the page so they become in view. Only then will Kantu find the image.

Here is my problem I need help with. The length of my web page varies day to day. My scripts run flawlessly one day and break the next. The only fix I know is to adjust my window.scroll values to adjust to the new page length.

Is there a workaround so I can build my Visual tests in a more robust way? How can do a visualAssert for an image when I don’t know exactly where on the page it will exist?


1 Like

No workaround needed, as there is a real solution :wink:

If you use visionLimitSearchArea | full all visual commands like visualAssert, visualVerify, XClick, XMove,… operate on the full web page. So technically UI Vision takes first a full page screenshot (just like captureEntirePageScreenshot does) and then runs the image search on it.

Thanks Timo - That sounds promising. I missed that option in the documentation somehow. Unfortunately, just adding it to the top of my macro didn’t magically fix everything. For example I now see the macro scroll and scans for everything looking for each image and yet it passes right by where it exists on the page. If I do an “Execute this command” - it is found with 0.92 confidence. (Provided it is visible)

I’ll play with it and see if I can make it work.