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

Dynamically handling width and height on Svg Tag

1 Answer 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mamata
Top achievements
Rank 1
Mamata asked on 19 Jun 2013, 08:48 PM
Is there anyway you can dynamically handle width and height on Svg Tag element? I have a script where I restore down a browser and make sure charts fits to the browser window. I basically login into website and restore down browser window and add a verification element to the test as shown below:
Verify attribute 'width' has 'Same' value of '968' on 'SvgTag0'
Verify attribute 'height' has 'Same' value of '252.5' on 'SvgTag0'
Test runs fine if always the width and height is exactly same. But usually this is not the case. If you resize and then restore down the attribute values will change. Is there any way you could handle this dynamically since its always hard to restore down the browser to exact same width and height?

Thanks,
Mamata


1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 24 Jun 2013, 05:58 PM
Hello Mamata,

What you're after is commonly called "fuzzy logic". Something like this can only be accomplished in a coded step. Our non-coded verification's can only handle static verification values since the values appear as strings as far as Test Studio is concerned.

In code you can parse the strings into int's or float's. Once you have a number stored in a variable in code you can do all sorts of range verification's on it. You'll still need to concretely define what is/isn't acceptable values so that you can write code that can correctly and automatically verify the values are acceptable or not.

Regards,
Cody
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
Tags
General Discussions
Asked by
Mamata
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or