NightWatch – 无法在具有值的input上find具有xpath定位器的元素
随着守夜,我有问题,我的网页上find一个元素,XPATH是好的,因为我已经find它与FirePath。
我的页码:
<label class="switch " data-ng-repeat="item in values"> <input class="ng-pristine ng-untouched ng-invalid ng-invalid-required" name="obtentionPermisConduiteAccompagneeSwitcher" value="N" ng- model="$parent.model" ng-required="!$parent.model" required="required" type="radio"/>
……
我的select器:
input_conduiteAccompagnee: { selector: './/input[@name="obtentionPermisConduiteAccompagneeSwitcher" and @value="N"]', locateStrategy: 'xpath' },
我的命令:
//conduite accompagnee onglet_conducteur.waitForElementVisible('@input_conduiteAccompagnee', 10000); onglet_conducteur.click('@input_conduiteAccompagnee'); browser.pause(3000);
但是我有这个信息:
×等待元素在10000毫秒内可见时超时。 – 预计“可见”,但得到:“不可见”
你有没有同样的问题?
我有几个问题要问1. waitForElementVisible代码
-
在firepath中inputxpath时会返回多less个元素
-
该元素是否在页面上可见或需要滚动?
@ Ratnadip,
它通过XPATH返回1个元素。 但我认为你有关于滚动的权利,因为我的元素在页面中较低。
我尝试了一些想:
onglet_conducteur.getLocationInView('@select_conduiteAccompagnee', function(result) { this.execute('scrollTo(result.value.x, result.value.y)'); this.execute('scrollIntoView'); });
但它不起作用。
谢谢
- hover在nightwatchjs中的链接
- 运行Nightwatch.jstesting时如何获得当前运行testing的浏览器名称?
- NemoJs vs NightWatchJS? 的优点和缺点
- 使用NightWatchJStesting脚本进行条件testing
- 在linux上使用nightwatch运行seleniumtesting
- 如何杀死在nightwatch中生成的进程globals.js before:function在after:函数中
- 有没有办法在Nightwatch中使用If语句来控制testing
- 守护程序不会在browser.end()后终止
- testing服务器上的seleniumtesting随机失败