Forum Discussion

meesh610's avatar
meesh610
Occasional Contributor
7 years ago

Inserting XPATH expressions into script - Web Based app

Looking for information on inserting XPATH expressions into my scripts.   What is happening is that I am getting errors after playing back my script that pertain to clicking on an edit button inside an angular grid page (table).  In the developers tools, it’s showing as a <button id="btn_edit_25" type="button" class="btn btn-primary btn-xs ng-binding ng-scope" ng-click="grid.appScope.editItemClick(row.entity.id)" ng-if="grid.appScope.isUser">Edit</button>  so need to use an XPATH expression or locator since it is a dynamic field. 

 

Is there a way to do this within Test Complete?  We have a field mapping csv file that we used in selenium/Jspringbot to located these button/id’s but not sure how to do that in Test Complete.  Any information is greatly appreciated!

 

Cheers!

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    When you use "Object Spy", can you find the button that way in TestComplete?  I'm assuming since it is a button within a table, it probably is a child object of the Cell... at least, that's best guess.  We can probably get around this without needing to use XPath... XPath functionality does exist in TestComplete but... you're not using Selenium any more and there are better, "best practices" ways of accessing objects in TestComplete... so, before using XPath, let's explore those.