Skip to content

← All questions

Coming from Selenium PageFactory — what replaces @FindBy and initElements?

Asked 16,320 views3 answers

We have a Java suite, maybe 300 tests, built the way everyone built them: a BasePage holding the driver and the waits, @FindBy(xpath = "//div[@class='cart']//button") fields, and PageFactory.initElements(driver, this) in every constructor. Glue code in a separate package maps Cucumber steps onto those page methods.

I am trying to work out what the equivalent shape is here before I start, because I do not want to port the mistakes as well. Specifically: what constructs the page object, where do the waits go, and does the glue layer survive?

asked by Dinuka Perera412 ·

3 answers

Have the same question?

Ask it with the command you ran and the output you got, and it will be answered here.

Ask a question

Related