Forum Discussion

DCat1223's avatar
DCat1223
Frequent Contributor
9 years ago

Help referring to an object in an automated Keyword test...

Good afternoon. I am testing a web based SharePoint application used to enroll employees and their family members in healthcare and dental plans. I have run into a snag creating an automated test to remove dependents from coverage. This is done by clicking the green “Covered” button, which moves the child from the green “Covered” side over to the red “Not Covered” side (attached screenshot).

 

The application numbers dependents, and behind the scenes that looks like the following:

Aliases.browser.pageHealthcareDependents.formEnrollmentform.panelDependent3.panelCovered where

panelDependent3” refers to the white box any given dependent may be in (including the spouse) and

panelCovered” refers to the Covered button.

 

The problem I am running into is that the dependents (which include the employee and spouse) are not necessarily numbered sequentially.

 

The employee themselves is always Dependent1.

 

The spouse you would expect is Dependent 2 but this is not always the case. An employee may re-marry for example and add a spouse after having kids on their, or if they add their kids before the spouse, this will also affect how the dependents are numbered.

 

Likewise, the kids may not always be in sequential order. This example in the screen shot may have older kids that are no longer covered (Joe Dependent in the screenshot). They could be Dependent3 or Dependent4 depending on the circumstance.

 

What I am asking is, is there a way to tell my automated keyword test to remove the top dependent (John Doe II in this example)? Right now the test script is looking for Dependent3 but Dependent3 may not always exist or be covered. Therefore I need it to remove the first “Covered” child dependent or first two, regardless if they are Dependent3 and 4 or if they may be Dependent7 and 8.

 

I hope this makes sense.

 

Thank you so much for your time and assistance!

 

Dave C.

  • Colin_McCrae and Marsha_R,

     

    I think I may have just figured this out - 5 minutes after my last post to you both.

     

    I started to tinker with the findObject Keyword test object, thinking I could do a find for dependent3 and if not found then look for dependent4 and do the required action.  Using that, I selected the button of the first dependent listed using the Object Spy in the findObject and it displayed as: Aliases.browser.pageHealthcareDependents.formEnrollmentform.table.cellDependentcellDependentcontai.panelCovered.

     

    Not the expected name containing "dependent4".  With nothing to lose, I put that in my test and it worked for both dependents 4 and 5!

     

    They say "even a blind squirrel finds a nut once in a while."  I guess this squirrel just found a nut. :) 

     

    I really want to thank you both for the time you've put into helping me out with this.  I just wonder why the findObject would yield a different result than the property. 

     

    Thank you!

     

    Dave.

  • Unless there's another property that will actually tell you that a specific slot holds a dependent, I think you're out of luck.  I'm guessing that your test is meant to cover being able to remove a dependent in any slot.  If that's the plan, I suggest that you redesign it a bit.  

     

    If a user is performing these actions, then they can see which one to remove, correct?  It's not going to be random. I think what you really want to know is can the app remove just the first one or just the second one, etc., properly.  Go ahead and set the data up with some large number of dependents, then remove and verify them one at time.  You could remove the last one and verify it, then the second to last one from the remaining list and verify, etc.  You can pick whatever order you like, but it's okay to have a fixed order to this.  

    • DCat1223's avatar
      DCat1223
      Frequent Contributor

      Thank you, Marsha.  I really appreciate the feedback.  Not the answer I was hoping for but thank you none the less. 

       

      I am not stuck on it deleting the first dependent, necessarily.  I just need to know the actual names of the dependents so i can ask to telete that dependent.  Are you aware of a way to determine the names?  If I can define if a dependent is definitively DependentX, I can have the test delete DependentX.  Is there a way to get the object name?

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Will the Object Spy let you look at the box with the actual name in it?  What does it show you there?