简体   繁体   中英

Selenium Webdriver (Java) - After pressing Submit button, it clears the passwords field ans stops the flow

I'm facing an issue in IE11 with Selenium in Java.

After sending the username and password to the fields, at the moment of pressing the Submit button, the field passwords gets cleared and it is not possible to carry on with the automation. Manually it works fine, but in Selenium I'm not able to continue the flow.

I already tried with the next, no success:

    WebElement Password = driver.findElement(By.id("TxbUSERPASSW"));
    Password.sendKeys(pass);
    JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
    jsExecutor.executeScript("$(arguments[0]).change();", pass);

    //Button Confirm
    driver.findElement(By.id("BtnConfirmSupv")).click();

Could anybody help me?

This is the button code:

<input type="submit" name="BtnConfirmSupv" value="Aceptar" id="BtnConfirmSupv" disabled="disabled" style="color:White;background-color:#043B75;border-width:3px;border-style:Outset;font-family:Tahoma;font-size:XX-Small;font-weight:bold;width:100px;">

Just remove this 2 lines of JavaScriptExecutor, It will work fine.

JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
jsExecutor.executeScript("$(arguments[0]).change();", pass);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM