本文介绍了点击在nightwatch.js中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用夜表时,有时单击在Firefox或Chrome中不起作用.我有以下代码
Sometimes clicks do not work in Firefox or Chrome when I am using nightwatch. I have the following code
browser
.waitForElementVisible('.example')
.click('.example')
.waitForElementVisible('body')
问题是点击事件不会触发.有谁知道为什么使用nightwatch.js时有时无法点击,以及您应该怎么做以适应这种情况?
The problem is the click event doesn't fire. Does anyone know why clicks sometimes do not work when using nightwatch.js and what you should do to accomodate this?
推荐答案
我想,您应该在功能waitForElementVisible('body', 1000 )中指定时间段.以此来更新代码,并看到您能够解决问题
I guess, you should specify the time period in the function waitForElementVisible('body', 1000). Update the code with this and see you are able to resolve the issue
有关waitElementVisible()的语法和示例,请参见此处
For syntax and example for waitElementVisible() see here
这篇关于点击在nightwatch.js中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!