mercredi 3 avril 2019

Page Object Model page initialisation

I'm using SeleniumExtras.PageObjects and therefore developed a dedicated Class for different pages in the application.

As a result, if a certain test involves more than one page, I need to include 3 separate page initialisation statements at the beginning of the test:

[FindsBy(How = How.Id, Using = "some Id")]
public IWebElement Page_1 { get; set; }

[FindsBy(How = How.XPath, Using = "some Xpath")]
public IWebElement Page_2 { get; set; }

[FindsBy(How = How.XPath, Using = "some Xpath")]
 public IWebElement Page_3 { get; set; }

Test starts...

Which makes the code cluttered..Is there an elegant way around it have a single statement in the code that calls all aval page objects so they be used in the test ?

Thanks.

Aucun commentaire:

Enregistrer un commentaire