Hi,
I am using ranorex to validate sizes of UI elements such as buttons etc. But
ValidateAnyAttributeValueOfAutomationElement(
string path,
string attrName,
object expectedValue,
string message = "",
bool exceptionOnFail = false)
is throwing an error when we pass the following "expected value" argument: new System.Drawing.Size(width, height)
Please let me know how i can validate sizes of UI elements.
Thanks in advance!
Validating Size attribute
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Validating Size attribute
Hi,
Which Ranorex method are you using in order to get the size of your element?
Regards,
Markus
Ranorex Support Team
Which Ranorex method are you using in order to get the size of your element?
Regards,
Markus
Ranorex Support Team
Re: Validating Size attribute
The size of the button was constant. So, I just instantiated a new system.drawing.size object with those constant width and height values and passed it to the ranorex's validate method.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Validating Size attribute
Hi,
The following code should work for you:
Regards,
Markus
Ranorex Support Team
The following code should work for you:
var start = repo.Start.Start; Validate.AreEqual(start.Element.Size, new Size(54, 40));I used the Windows start button for test purposes and this worked as expected on my machine.
Regards,
Markus
Ranorex Support Team
Re: Validating Size attribute
Thanks a lot! It works!