Dans le code ci-dessous, je ne peux pas envoyer de mot de passe dans le champ mot de passe, j'ai essayé de cliquer sur le champ, effacer le champ et envoyer les clés. Mais maintenant, travailler dans n'importe quelle méthode. Mais son fonctionnement si je débogue et le testélément non interactif exception dans la web automation selenium
public class TestMail {
protected static WebDriver driver;
protected static String result;
@BeforeClass
public static void setup() {
System.setProperty("webdriver.gecko.driver","D:\\geckodriver.exe");
driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
}
@Test
void Testcase1() {
driver.get("http://mail.google.com");
WebElement loginfield = driver.findElement(By.name("Email"));
if(loginfield.isDisplayed()){
loginfield.sendKeys("[email protected]");
}
else{
WebElement newloginfield = driver.findElemnt(By.cssSelector("#identifierId"));
newloginfield.sendKeys("[email protected]");
// System.out.println("This is new login");
}
driver.findElement(By.name("signIn")).click();
// driver.findElement(By.cssSelector(".RveJvd")).click();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
// WebElement pwd = driver.findElement(By.name("Passwd"));
WebElement pwd = driver.findElement(By.cssSelector("#Passwd"));
pwd.click();
pwd.clear();
// pwd.sendKeys("123");
if(pwd.isEnabled()){
pwd.sendKeys("123");
}
else{
System.out.println("Not Enabled");
}
bonne explication :-). Son fonctionnement comme prévu, merci beaucoup. –