简体   繁体   English

Selenium Webdriver(Java)-按Submit按钮后,它将清除密码字段并停止流程

[英]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. 我在IE11中遇到了Java中的Selenium问题。

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. 在将用户名和密码发送到字段后,在按下Submit按钮时,字段密码将被清除,并且无法继续进行自动化。 Manually it works fine, but in Selenium I'm not able to continue the flow. 手动可以正常工作,但是在Selenium中,我无法继续执行该流程。

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. 只需删除这2行JavaScriptExecutor,它将可以正常工作。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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