Page 1 of 1

using usercode to obtain screen resolution

Posted: Wed Apr 02, 2014 11:33 am
by Mozzytm
Hi there,

I'm trying to write swipe left and right functions for use in a mobile test script to do this id like to know the bounds of the screen on whatever device i'm using.

Could anyone advise me on what the code is for this?

Thanks

M

Re: using usercode to obtain screen resolution

Posted: Thu Apr 03, 2014 3:19 pm
by Support Team
Hi,

You can for instance use the following code to get the ScreenRectangle of the main form:
var mainForm = repo.YourElement.YourMailForm;
var rect = mainForm .ScreenRectangle; // you can also get the length and height
Report.Info("bounds: "+rect.ToString());
Regards,
Markus

Re: using usercode to obtain screen resolution

Posted: Fri Apr 04, 2014 10:52 am
by Mozzytm
Thankyou very much for this.