Forum Discussion

meesh610's avatar
meesh610
Occasional Contributor
6 years ago

Getting errors during playback - cannot find the edit button.

Need help with editing this:  Object Aliases.browser.pageQaregTtxrdmComSx200AngappAng.buttonEdit

 

to the following: 

 

Edit button - Results of inspect element: 

 

<button id="btn_edit_3" 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>

 

 

 

 

4 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The object is mapped in some way... it has an Alias.  So, the inspection you have posted doesn't really help in figuring out your problem.  That is simply how the HTML is written for the button.  What we need is a screenshot showing the object identification criteria in NameMapping for the button in question.

     

    Additionally, the problem could be not with the button itself but with timing.  If you are performing an action on the page that causes something to load where the button is not available immediately, you may need to add additional code or steps to wait an appropriate amount of time for the button to become available.

     

    See https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/waiting-process-or-window-activation.html

    • meesh610's avatar
      meesh610
      Occasional Contributor

      Screenshot attached showing the object identification in NameMappin.

       

      Thank you!

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        So,what I'm seeing is an edit button that is in a cell in a table, is that correct?  

         

        Notice that it is mapped with a idStr of "btn_edit_2" while the information you posted before shows it as btn_edit_3.  So, what this tells me is that there are multiple edit buttons on the screen (and you can see it in the NameMapping image capture).  Each one is identified differently.

         

        You will need to work on a strategy of some sort to determine the best way to identify which edit button you want to work with.  Since it is a button in  a cell in a table that may have variable length, I would honestly not map the buttons themselves.  I'd do a mapping of the table and then use some sort of code to dynamically select the row and column in the table and reference the button from there.