单击按钮后是否可以立即进行验证. [英] Is it possible to validate immediately after clicking on Button.

查看:154
本文介绍了单击按钮后是否可以立即进行验证.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在单击按钮"后立即进行验证.

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:

JavascriptExecutor js = (JavascriptExecutor)driver;

WebElement element = driver.findElement(By.whatever("anything"));
js.executeScript("arguments[0].click()", element);

这两种解决方案都会立即将浏览器控件移交给您,因此您可以在卸载页面之前验证数据.

Both these solutions will immediatelly return the browser control to your hands, so you can validate your data before the page gets unloaded.

这篇关于单击按钮后是否可以立即进行验证.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆