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.