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

Expand Node by Index instead of Text

2 Answers 61 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 12 Nov 2014, 10:40 PM
I recorded a test wherein I encountered a RadTreeView. I expand a parent node, then a child node, then the child's child node.

When I execute the test it fails at the point where it attempts to expand the first node. It fails because it is searching for the text in the node but can't find it since the text of the node changes each time the test is run.

So, I believe I need to have the test expand the nodes by index instead. Is there a setting that will accomplish this? Or can this only be solved by developing a coded step(s)?



When it was recorded:
RadTreeView('ctl00_ctl00_cphMain_rc_ProfileContent_rdTree_treePreferences'): 'CustomerA' action -> 'Expand'
Pages.UserProfile.CphMainRcProfileContentRdTreeTreePreferencesDiv.ExpandNodeByText("CustomerA");

When the test ran:            
RadTreeView('ctl00_ctl00_cphMain_rc_ProfileContent_rdTree_treePreferences'): 'CustomerB' action -> 'Expand'")]

2 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 13 Nov 2014, 07:49 PM
As a solution to get me by for now, I'm querying the database for [$(UserName)], [$(CustomerName)], [$(ContractName)], to dynamically data-drive the test (each time the test runs, a different UserName/CustomerName/ContractName combo is used by selecting the TOP 1 row from a TABLESAMPLE).

I'm not sure how brittle or solid this solution is. I need to figure out if it's searching each node for the data-driven variable until it finds it.....or if it's only looking in the first node (so far, each time I've run the test the selected variable has been in the first node).
0
Accepted
Cody
Telerik team
answered on 17 Nov 2014, 10:22 PM
Hi Scott,

No unfortunately there is no setting to select by index on the RadTree. Instead I suggest you disable the RadTreeView translator as shown in the attached screen shot, then re-record those steps. It will change the recording so that it clicks on the same expander element w/o regard for the text of that element. See the second screen shot for an example of the recording.

Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Cody
Telerik team
Share this question
or