0

I have webpage with 60 textinputs. All of this inputs has 'info' links which expand/collapse textbox (see example) with description for required input. I have a file with all required strings. I need to check expand/collapse functionality and text inside textboxes. I'm wondering what is the best way to design testcase(s)? Do I need to describe all this 'info' links in my Page.class and create separate tc for each one? or I can implement it in one tc ? As a workaround I can use txt file which contain following information for all required links infoLinkHref | textboxContent but such implementation is outside of page-object model and looks dumb.

user3535807
  • 248
  • 2
  • 3
  • 15

1 Answers1

1

Assuming that checkboxes have sequent numbers like in your example I would try to use next method (it kind of pseudo code)

public string myCheckboxText(string checkboxNameOrNumber) {
  WebElement checkbox = driver.FindElement(By.checkboxNameOrNumber);
  return textOfCheckboxToBeVerified;
}

In test you can verify it as Assert.assertEquals(MyPage.myCheckboxText(checkbox_1), expectedText) and put assertion in loop to check through number of checkboxes. expectedText can be enterd manually or to be read from file. I think it does not contradict PageObject pattern and your current implementation.

olyv
  • 3,699
  • 5
  • 37
  • 67