-1

我在 LeanFT 中使用 TestNG。我为页面创建了单独的类并识别了对象,如下面的代码片段所示:

public class HomePage {
    private Browser browser;

    public HomePage(Browser browser) throws GeneralLeanFtException {
        this.browser = browser;
    }

    Button sendButton = browser.describe(Button.class, new ButtonDescription.Builder()

我无法在测试类中初始化 web 元素,无法使用PageFactory,因为得到了NullPointerException.

PageFactory.initElements(browser, page);
4

1 回答 1

-1

该项目包含使用 LeanFT 和 TestNG 的模板: https ://github.com/kohli-harshit/leanft-testng-template

LeanFT SDK and Report initialization
Logging with Log4J
Utils to Read from Properties File
Utils to Create Data Driven Tests from CSV Data
TestNG listeners used
于 2018-05-18T11:07:22.767 回答