Dynamically handling width and height on Svg Tag

2 posts, 0 answers
  1. Mamata
    Mamata avatar
    7 posts
    Member since:
    Jul 2011

    Posted 19 Jun 2013 Link to this post

    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?


  2. Cody
    Cody avatar
    3354 posts

    Posted 24 Jun 2013 Link to this post

    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.

    Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
    Reserve your seat today!
Back to Top