作者:鱼红1993 | 来源:互联网 | 2023-08-05 20:48
HereIhavetoselectthecheckboxusingseleniumandImnotabletoselectit.Ithasonlyoneopt
Here I have to select the checkbox using selenium
and I'm not able to select it. It has only one option of classname that I'm using but error is appearing:
在这里,我必须使用selenium选择复选框,我无法选择它。它只有一个我正在使用的classname选项,但出现错误:
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"class name","selector":"um-icon-android-checkbox-outline"}
org.openqa.selenium.NoSuchElementException:没有这样的元素:无法找到元素:{“method”:“class name”,“selector”:“um-icon-android-checkbox-outline”}
code
码
@Test
public void validemail()
{
WebElement email=driver.findElement(By.id("username-15"));
email.clear();
email.sendKeys("ceicateviewer");
WebElement password=driver.findElement(By.id("user_password-15"));
password.clear();
password.sendKeys("1256Aa");
WebElement showpassword=driver.findElement(By.className("um-icon-android-checkbox-outline"));
showpassword.click();
WebElement keepsignin=driver.findElement(By.className("um-icon-android-checkbox-outline"));
keepsignin.click();
/*WebElement login=driver.findElement(By.className("um-button"));
login.click();*/
}
1 个解决方案