where does test studio stores the xpath for the element

4 posts, 0 answers
  1. Shruti
    Shruti avatar
    8 posts
    Member since:
    Aug 2012

    Posted 30 Aug 2012 Link to this post

    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


  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 30 Aug 2012 Link to this post

    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
  3. Shruti
    Shruti avatar
    8 posts
    Member since:
    Aug 2012

    Posted 31 Aug 2012 Link to this post

    Hello Plamen,

    Thanks for the response.
    It was really helpful.

    Regards,
    Shruti
  4. Amit
    Amit avatar
    4 posts
    Member since:
    Nov 2012

    Posted 21 Dec 2012 Link to this post

    Thanks Plamen,

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

    Amit
Back to Top