Element validated but not selected on the test run

5 posts, 0 answers
  1. Uroš
    Uroš avatar
    37 posts
    Member since:
    Dec 2013

    Posted 28 Jul 2015 Link to this post

    I have recorded a web action which validates an element with TagIndex (picture Original.Element), which works OK. But since the element index changes from time to time, I change the validation to be more general. I have used suggested elements (picture Modified.Element) and validation process was successful in the live view mode. But when I execute the test, the element (button Confirm) is not selected. I have enclosed test scenario (WebTest.Updated) for the replication.
  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 31 Jul 2015 Link to this post

    Hello,

    Thanks for providing the images and tests!

    I'm running the tests locally but at least the .Updated one fails most of the times on a prior step - 7. Click 'EditDiv'. I suspect that's something with the tag index too so you may want to update that one as well.

    I got the test passed once and it did not fail clicking on the updated Confirm span. Still I can suggest validating the find logic from the Find Element dialog on connected recorder. Just pay attention if it will highlight (make sure recorder highlighting is on) the expected element or it finds another element matching the given criteria earlier in the DOM. If it locates the correct element you can also try SimulateRealClick step property.

    Please let us know if you need further assistance.

    Regards,
    Konstantin Petkov
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  3. Uroš
    Uroš avatar
    37 posts
    Member since:
    Dec 2013

    Posted 31 Jul 2015 in reply to Konstantin Petkov Link to this post

    I have missing one detail with this test issue, you need to manually change the method to Disabled in the web application once you successfully executed the test, because otherwise the confirm dialogue is different. See att.

     

     

  4. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 03 Aug 2015 Link to this post

    Hi,

    The test runs fine today. It actually stopped at the edit button click just once out of 10 or so times.

    I think I figured out the problem and that was exactly my suspicion - there is another button earlier in the DOM which matches the given search criteria. It's hidden and does nothing at this point of the test but causes the problem. I'm attaching a screen capture of the DOM from the recorder where you can see it's the exact same markup. Unfortunately that means you can only use XPath or TagIndex to locate the correct button to click.

    BTW, an easy way to spot such problem is running the test with Annotation on. Test Studio highlights the exact element rectangle on click so you can clearly see if it locates the correct element or not. If it doesn't highlight at the expected place this means it locates another element. In such situation just open the DOM and use the search option to find the similar (or absolutely exact) element instances.

    I hope this helps!

    Regards,
    Konstantin Petkov
    Telerik
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
  5. Uroš
    Uroš avatar
    37 posts
    Member since:
    Dec 2013

    Posted 05 Aug 2015 in reply to Konstantin Petkov Link to this post

    Yes, there is another button earlier in the DOM. I will update my test to select the second one.

     Thanks for your time.

Back to Top