Unplanned
Last Updated: 09 Dec 2014 13:48 by ADMIN
ADMIN
Boyan Boev
Created on: 14 Aug 2014 12:11
Type: Feature Request
0
Ability to treat custom HTML attribute as unique building nested find logic in Test Studio
Consider the following html:

<html>
<body>
<div id="test-div2"><p>Test2</p></div>
<div data-o9-uid="test-div2"><p>Test2</p></div>
</body>
</html>

Where the attribute "data-o9-uid" is added as custom attribute in the identification schemes for recording find logic in Test Studio.

Record click steps for the both divs.

Actual find expression recorded:

[id 'Exact' test-div2][TagIndex 'Exact' p:0] for the first div.

[TagIndex 'Exact' p:1] for the second div.

Expected find expression:

[id 'Exact' test-div2][TagIndex 'Exact' p:0] for the first div.

[data-o9-uid 'Exact' test-div2][TagIndex 'Exact' p:0]
4 comments
ADMIN
Konstantin Petkov
Posted on: 22 Aug 2014 09:51
I'm afraid you got it wrong - there is no way currently to tell Test Studio to treat a custom attribute as unique. That's what this feature request stands for.

I'm updating the title to make it clear.
Pandiarajan
Posted on: 22 Aug 2014 09:39
We have tested the latest version of Test Studio (2014.2.807.0), in which "Name" attribute is not working like "Id". (atleast in Chrome)

And by adding to Identification Logic, we are telling the Test Studio to treat the custom attribute as unique. Not sure what else needs to be given ! (also to contradict your point, how you can assume Id or Name is going to be unique ?)

and http://feedback.telerik.com/Project/161/Feedback/Details/133942-custom-html-attributes-in-find-logic-not-detected-when-using-js-recorder is accepted as bug and the fix is given in the internal build is not working properly.
ADMIN
Konstantin Petkov
Posted on: 22 Aug 2014 06:53
In addition, Test Studio should not blindly use any custom attribute added to the list to build those find expressions for nested elements as that can mess up the recording and playback. This feature (once implemented) should let the user explicitly confirm to Test Studio the added attribute has unique values in the application under test so that TS can build reliable find logic accordingly. This is a bit tricky but important detail designing this feature.

I hope this clarifies the specifics about this request.
ADMIN
Iliyan Panchev
Posted on: 22 Aug 2014 06:39
The current logic for building Chained Find Expressions is hard-coded. If the target element is found only by TagName and Index we're looking for the nearest parent with "Id" and "Name" attributes. 
In order to use another attribute, we need to be sure that it is unique. To do this for custom attributes we need to implement whole new logic, which is more like a feature request. So, I am setting this as a feature request.