Forum Discussion
Colin_McCrae
11 years agoCommunity Hero
Not sure why your comparisons are failing. As mentioned above, image compares are notoriously fickle.
But one thing I will add, is where you are capturing a screenshot of a webpage .... you are not controlling the size of the browser. If someone manually re-sizes the browser, it may well open at that size the next time your test starts a browser.
So I would suggest you add some extra code to control the browser size. It can be a problem causing visibility failures and accessing controls. But for image compares, in my book, controlling the browser size if pretty much essential if you want accurate results. All my scripted tests open browsers of very specific sizes so I always know what I'm dealing with during a run.
(Note - the way you control the size of IE vs Chrome in code - VBScript in my case - is different. So you'll need to know the browser in use and apply the sizing code to each accordingly. No idea about FireFox, I don't use that at work.)
But one thing I will add, is where you are capturing a screenshot of a webpage .... you are not controlling the size of the browser. If someone manually re-sizes the browser, it may well open at that size the next time your test starts a browser.
So I would suggest you add some extra code to control the browser size. It can be a problem causing visibility failures and accessing controls. But for image compares, in my book, controlling the browser size if pretty much essential if you want accurate results. All my scripted tests open browsers of very specific sizes so I always know what I'm dealing with during a run.
(Note - the way you control the size of IE vs Chrome in code - VBScript in my case - is different. So you'll need to know the browser in use and apply the sizing code to each accordingly. No idea about FireFox, I don't use that at work.)