注释类型FindBy的属性css未定义

时间:2018-12-11 02:01:12

标签: selenium

我正在尝试使用Selenium进行此自动化测试:

package pageobject;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class loginpage {
    private WebDriver driver;

    @FindBy(css="div.mod-login-input-loginName>input")
    public WebElement txtUserName;
    @FindBy(css="div.mod-login-input-loginName>span")
    public WebElement lbUserNameError;
    @FindBy(css="div.mod-login-input-password>input[type=password]")
    public WebElement txtPassword;
    @FindBy(css="div.mod-login-input-password>span")
    public WebElement lbPasswordError;
    @FindBy(css="button.next-btn-primary")
    public WebElement btnLogin;
    @FindBy(css="div.next-feedback-toast")
    public WebElement pnlNotifier;
    @FindBy(css="div.next-feedback-toast .next-feedback-content")
    public WebElement lbNotification;

    public loginpage(WebDriver driver)
    {
        this.driver=driver;
        PageFactory.initElements(driver, this);
    }
}

我收到以下错误消息:

注释类型FindBy的属性css未定义

我该如何解决?

0 个答案:

没有答案