单击按钮后是否可以立即进行验证. [英] Is it possible to validate immediately after clicking on Button.
问题描述
是否可以在单击按钮"后立即进行验证.
Is it possible to validate immediately after clicking on Button.
假设有一个提交按钮.而且我需要单击提交"按钮,并且在下一页加载之前,我需要确认提交"按钮已禁用...
Assume, there is submit button. And i need to click on Submit button and before the next page load i need to validate submit button is disabled...
推荐答案
是的!您可以使用以下任一选项来执行无阻塞点击:
Yes! You can perform a nonblocking click by using either one of these:
高级用户交互API (
或JavaScript: or JavaScript: 这两种解决方案都会立即将浏览器控件移交给您,因此您可以在卸载页面之前验证数据. Both these solutions will immediatelly return the browser control to your hands, so you can validate your data before the page gets unloaded. 这篇关于单击按钮后是否可以立即进行验证.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!JavascriptExecutor js = (JavascriptExecutor)driver;
WebElement element = driver.findElement(By.whatever("anything"));
js.executeScript("arguments[0].click()", element);