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

Element validated but not selected on the test run

4 Answers 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Uroš
Top achievements
Rank 2
Uroš asked on 28 Jul 2015, 06:09 AM
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.

4 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 31 Jul 2015, 06:15 AM
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!
0
Uroš
Top achievements
Rank 2
answered on 31 Jul 2015, 06:56 AM

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.

 

 

0
Konstantin Petkov
Telerik team
answered on 03 Aug 2015, 10:30 AM
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!
0
Uroš
Top achievements
Rank 2
answered on 05 Aug 2015, 06:42 AM

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

 Thanks for your time.

Tags
General Discussions
Asked by
Uroš
Top achievements
Rank 2
Answers by
Konstantin Petkov
Telerik team
Uroš
Top achievements
Rank 2
Share this question
or