简体   繁体   English

Selenium WebDriver - 单击“保存”按钮后应用程序无响应

[英]Selenium WebDriver - Application becomes unresponsive after clicking on Save button

I am automating one of the scenario which contains entering few details and then click on Save button.我正在自动化包含输入一些细节的场景之一,然后单击“保存”按钮。 Manually when i am performing the steps, it hardly takes 5 to 8 sec to process and complete.当我手动执行这些步骤时,处理和完成几乎不需要 5 到 8 秒。 But same performing via automation script, it just keep on loading for infinite time.但是同样通过自动化脚本执行,它只是无限时间地继续加载。

Below is the html code for Save button :下面是保存按钮的 html 代码:

<button class="blueFilledButton ng-binding" ng-click="validateIdea(validateIdeaForm)" ng-disabled="userNotFound || PoupupButtonDisabled || incorrectValidDate" tabindex="0" aria-disabled="false">Save</button>

Selenium code: I have tried with below click methods : Selenium 代码:​​我尝试过以下点击方法:

Case - 1 :情况1 :

driver.findElement(By.xpath("//button[text()='Save']")).click();

Case - 2 :案例 - 2:

Actions builder = new Actions(driver);
builder.moveToElement(driver.findElement(By.xpath("//button[text()='Save']"))).click().perform();

In both the cases it just keeps on loading.在这两种情况下,它都会继续加载。

Is it due to any script is being invoked after clicking on Save button, and webdriver is not compatible with it?是不是因为点击保存按钮后调用了任何脚本,而webdriver与之不兼容?

Please help.请帮忙。 Thanks in advance.提前致谢。

根据 HTML,您已将<button>与文本共享,因为Save是一个Angular 元素,因此您必须引入WebDriverWait以使元素可点击,如下所示:

new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//button[@class='blueFilledButton ng-binding'][@ng-click=\"validateIdea(validateIdeaForm)\"]"))).click();

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

相关问题 Selenium Webdriver-单击一个按钮 - Selenium Webdriver - Clicking on a button Selenium WebDriver- Java-单击“添加文件”按钮以将其上传到应用程序后,文件上传失败 - Selenium WebDriver- Java - File Upload Fails after clicking on Add Files button to upload them to Application Chrome浏览器有时无法在单击我网站上的按钮时反应迟钝 - Chrome sometimes becomes unresponsive on clicking a button on my website Selenium Webdriver,单击按钮不起作用 - Selenium Webdriver, clicking a button not working 登录后使用 selenium webdriver 单击图像按钮 - Clicking an image button using selenium webdriver after login Selenium WebDriver没有单击第一个按钮 - Selenium WebDriver is not clicking on first button 连续运行约6小时后,Swing应用程序无响应 - Swing application becomes unresponsive after keeping operating for about 6 hours continuously 使用Selenium WebDriver在Gmail中单击“撰写”按钮 - Clicking Compose button in Gmail using Selenium WebDriver Selenium Webdriver识别按钮并使用Java单击它 - Selenium webdriver identify button and clicking on it using Java 单击与表单页面相对应的单选按钮的值-Java-Selenium Webdriver - Clicking on a value of the radio button in accordance with the sheet page - Java - Selenium Webdriver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM