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

where does test studio stores the xpath for the element

3 Answers 203 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shruti
Top achievements
Rank 1
Shruti asked on 30 Aug 2012, 12:30 PM
Hello All,

I am trying Test studio to check if it works for me.
One of the features I noticed is, If test studio is not able to find the element based on its Find Logic,  it tries to find the element using backup search.
For my test, I am getting following message in TestResults:

23    Enter text 'Instruction 1' in 'Instruction1TextArea'
Element was found by backup search only! We recommend editing the element to correct the primary find expression.
Primary Find Expression: id=DropParent5469,|,tagIndex=textarea:0
Element was found by backup search: xpath=/html[1]/body[1]/div[3]/div[2]/div[1]/div[1]/div[3]/div[1]/div[1]/textarea[1]        Pass



I want to know, where does test studio stores the xpath for the element? Is there any way to find out the xpath without executing test(from element definition or something like this)?
Also, Is there any way to specify the test to find elements based on xpath only?


Thanks and Regards,
Shruti


3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 30 Aug 2012, 01:31 PM
Hello Shruti,

The Backup Search is a new feature in Test Studio. If the Find Logic of an element fails, Test Studio uses the XPath for HTML based applications or XamlPath for Silverlight based apps as a backup search option.

The xpath for the element is stored in the test XML. If you open the .tstest file with a text editor, you'll find the "BackupSearchClause" tag where the xpath is stored(see screenshot).

However, the easiest way to get the xpath of an element is to bring up the Find Element menu for the specific element from the Elements Repository. Then connect to the live page and use the Suggestions. From there you can also edit the find logic and set the xpath as a default search option for the target element. Check out our Find Elements article for more information on how to change the find logic.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Shruti
Top achievements
Rank 1
answered on 31 Aug 2012, 07:56 AM
Hello Plamen,

Thanks for the response.
It was really helpful.

Regards,
Shruti
0
Amit
Top achievements
Rank 1
answered on 21 Dec 2012, 07:27 AM
Thanks Plamen,

I really needed this information.This is of great help.

Amit
Tags
General Discussions
Asked by
Shruti
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Shruti
Top achievements
Rank 1
Amit
Top achievements
Rank 1
Share this question
or