Forum Discussion

DCat1223's avatar
DCat1223
Frequent Contributor
6 years ago
Solved

Set the value of an object property in Name Map to a variable value.

Hi.  I have a web based, keyword test that is giving me some trouble.  I am testing security roles for different users for an application.  Depending on who I am testing as, objects may or may not display in the UI.  In addition, one user may see an Info button where another will see an Edit button for example.

I have attached an example of what a role might seebelow. 

 

The EDIT buttons are giving me the trouble.  Specifically, I need to be able to identify that a user can edit Next Performance Review Date or Business Continuity Team but I have no way of identifying these button every time as the button properties all change based on user.  So TC has a hard time differentiating the different Edit buttons from the mapped button due to the properties always changing. 

 

 

Here’s what I do have:

The Next Performance Review Date and Business Continuity Team sections I can easily identify by their contentText Property.  So I have no trouble finding those.  Additionally, based on being able to find this, I can very easily determine the ID’s of these sections, which is an integer ranging from 0 – 40 depending on the number of objects displayed.

     Again, this ID changes depending on what else displays.  I know that the ID of the corresponding Edit button is NextPerfomanceReviwDate.ID +1 for it’s corresponding Edit button and BusinessContinuityTeam.ID +1 for it’s corresponding Edit button.   So in the screenshots above, the ID for the Next Performance Review Date section is 10.  It’s corresponding Edit button ID is 11.  Again, these are not the same for each role I need to test, nor are the other properties but the button ID is always one more than the ID of it's corresponding Object.

 

Using the Set Variable Value operation in the Keyword Test operations, I was able to create a temporary variable to be NextPerfomanceReviwDate.ID +1.  I was hoping to be able to assign this to the ID property of my Edit button in Name Mapping.

Is there a way to assign the ID property of my object mapped for the Edit button to be = to the variable I created for NextPerfomanceReviwDate.ID + 1?

 

Any other suggestions? 

 

Thank you for your time!

 

Dave.

 

  • Thanks, Marsha_R .  Can you please elaborate a bit more on your recomendation to construct the object name?  I'm not sure I'm following you, but it sounds like a much simpler solution.  

4 Replies

    • DCat1223's avatar
      DCat1223
      Frequent Contributor

      Thanks, Marsha_R .  Can you please elaborate a bit more on your recomendation to construct the object name?  I'm not sure I'm following you, but it sounds like a much simpler solution.  

      • DCat1223's avatar
        DCat1223
        Frequent Contributor

        Marsha_R  - I got this figured out and it's working great.  I had my variable assigned on the test rather than at the project level.  Thanks again for your suggestion! 

  • cunderw's avatar
    cunderw
    Community Hero

    If you can identify the parents and there is only one child button, can you not just find the first button available instead of relying on the id property? Seems like a much more simple way of finding the button. 

     

    Screenshots of the both sections and their buttons in the object browser would also help determine a better course of action.