を使用してフォーム フィールドにユーザー名とパスワードを渡そうとすると、エラーが発生しますsendKeys
。以下は私のユーザークラスで、その後にテストクラスが続きます。アプリケーションが文字列を渡さない理由を知っている人はいますか?
org.openqa.selenium.WebDriverException: 不明なエラー: キーは文字列でなければなりません
public class User {
public static String username;
public static String password;
public User() {
this.username = "username";
this.password = "password";
}
public String getUsername(){
return username;
}
public String getPassword(){
return password;
}
}
@Test
public void starWebDriver() {
driver.get(domainURL.getURL());
WebElement userInputBox, passInputBox;
userInputBox = driver.findElement(By.xpath("//input[@name='email']"));
passInputBox = driver.findElement(By.xpath("//input[@name='password']"));
System.out.println("before sending keys");
userInputBox.sendKeys(User.username);
}