Selenium java.lang.NullPointerException with PageFactory
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to get a hang of PageFactory POM, however something is not working and I can not understand what is wrong. This is my first POM class for Home Page: package PageFactory; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class Home_Page_POF { public WebDriver driver; @FindBy(css = "div#header-profile a#header-profile-toggle") public WebElement profileToggleButton; @FindBy(css = "form#loginUserdataForm div