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代码

  1. 在firepath中inputxpath时会返回多less个元素

  2. 该元素是否在页面上可见或需要滚动?

@ Ratnadip,

它通过XPATH返回1个元素。 但我认为你有关于滚动的权利,因为我的元素在页面中较低。

我尝试了一些想:

 onglet_conducteur.getLocationInView('@select_conduiteAccompagnee', function(result) { this.execute('scrollTo(result.value.x, result.value.y)'); this.execute('scrollIntoView'); }); 

但它不起作用。

谢谢