This is a migrated thread and some comments may be shown as answers.

Setting the Resolution for a test/test list

10 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 04 Sep 2013, 09:12 AM
Hi,

We're trying to share tests across a team and are finding that image verification is failing on some steps.

In some cases, we have to use image verification as we're testing a silverlight charting application with custom controls and cannot verify the data any other way. Any changes to the resolution of the browser window directly affects the display of these controls.

Thus, we need a way to set the browser window size/resolution consistently across our tests.

We could use ActiveBrowser.Window.Maximize();however, our screen sizes differ (laptops, 2nd monitors etc.).

What we need is something like ActiveBrowser.Window.SetResolution(1024,768), does something like that exist?

Thanks,
Paul.


10 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 04 Sep 2013, 09:21 PM
Hello Paul,

Yes you can use code like this to move and resize the window to your desired location and size in width and height:
ActiveBrowser.Window.Move(new System.Drawing.Rectangle(0, 0, 1024, 768), false);

Regards,
Cody
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Paul
Top achievements
Rank 1
answered on 05 Sep 2013, 09:14 AM
Brilliant, thanks Cody!

For the benefit of anyone else reading this- we also had to add the System.Drawing.dll assembly reference from

C:\Windows\Microsoft.NET\Framework\v4.0.30319

to get it to compile.
0
Reese
Top achievements
Rank 1
answered on 24 Apr 2014, 02:25 PM
Hey there,

I was having the same problem as Paul and used the fix recommended by Cody and it worked for IE however, when I try and run the test in Chrome and FF I am getting large variances in the image verification because of the differences in browser formats such as navigation bar size etc. changing the image locations. I guess my question is, is there a way to trim the browser windows down to just the content so that all three browsers have the same formatting? Or is there another solution to this problem I'm not thinking of?

Thanks,
Reese
0
Cody
Telerik team
answered on 28 Apr 2014, 08:59 PM
Hi Reese,

What exactly are you doing an image verification of? The entire browser window? Doing an image verification of the entire browser window is always going to be very brittle, even in the same browser. Any small change in the UI will cause your verification to break.

The only recommendation I can give you is to trim the verification size just a bit as shown in the attached screen shot.

Regards,
Cody
Telerik
0
Reese
Top achievements
Rank 1
answered on 01 May 2014, 04:46 PM
Thank you for your reply Cody,

I should have been more specific in my first post, I am using a small verification area to try and verify that a page has been rotated after the rotate button is pressed and also to verify that the pages of a document can be reordered. Image verification seems to be the only way to verify this and it does successfully in IE just not across all browsers. I have messed around with ActiveBrowser.ResizeContent to make the content dimensions of each browser align with each other however this did not work either. I apologize as I am new to Test Studio but I just cannot seem to figure this out. Is there an alternative verification method I could use? If not, am I able to get around this somehow? Any help would be greatly appreciated!

Thanks,
Reese
0
Cody
Telerik team
answered on 05 May 2014, 08:11 PM
Hi Reese,

...try and verify that a page has been rotated after the rotate button is pressed ...

Rotating a "page"? How big is page in terms of pixels? I can understand rotating an image on a web page, but rotating the page sounds strange to me. Can you capture a video how this is done in your application and show me? Jing is a good free screen recorder for up to 5 minutes of recording. That may help me understand what is being done and what we have available to work with. I'm having difficult imagining the operating based on text description alone.

...verify that the pages of a document can be reordered.

This is another item I need to see to understand how it works and see what we have to work with in terms of verifications.

Regards,
Cody
Telerik
0
Reese
Top achievements
Rank 1
answered on 06 May 2014, 06:53 PM
When I said page rotation what I meant was image rotation not the web page, the point is to upload a document or file and be able to rotate it once uploaded. I have found that the image quality varies between browsers causing errors when running the test across them. I have attached an image comparing two images being captured by Test Studio during a test, the image with the red box around it is the image I used to record the test (in Internet Explorer) and the one without the red box is the one from running the test (in Chrome). You can see a noticeable difference in quality causing the error so is there a way to account for this? or just bump up the tolerance in the test?
0
Cody
Telerik team
answered on 09 May 2014, 07:13 PM
Hi Reese,

Because the images are so radically different I'm thinking a different approach would be better. Record up to 4 different image verification's, one for each browser you want to run the test in. Use the Test Step Properties to run each verification in a specific browser (the  RunsAgainst property). Record one in IE and set it to run only in IE. Record one in Chrome and set it to run only in Chrome, and so on.

In the end you have image verification's that are tailored to each browser.

Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Reese
Top achievements
Rank 1
answered on 12 May 2014, 01:11 PM
That was my plan initially but I cannot seem to figure out how to record image verification's in Chrome or Firefox. Am I just overlooking this somehow or is that feature not available for the Chrome and FF recorders?
Thanks
0
Cody
Telerik team
answered on 12 May 2014, 09:49 PM
Hi Reese,

Sorry about that. You're right you cannot record an image verification when recording in browsers other than IE. I added a feature request. Hopefully we can add it in the near future.

After doing some studying on this, I'm going to recommend that you simply don't do image verification steps in browsers other than IE (until we've implemented the feature request). I used the image at the top of this page for my study. The results of my study can be seen in the attached .zip file.

To the naked human eye the image looks identical in all three browsers, but using a third party comparison tool there are significant differences between them. The third party tool generates new images showing the differences it detected between two reference images. After comparing the output from all 3 browsers you can see there are significant differences and Test Studio will always see them as more than 100% different (based on a color histogram comparison).

Alternative methods of handling your test case include:
  1. Simply doing it manually in the various browsers
  2. Capture an image of the browser automatically then visually inspecting the image to verify it is correct


Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Cody
Telerik team
Paul
Top achievements
Rank 1
Reese
Top achievements
Rank 1
Share this question
or