0
이 질문은 인턴으로 작성된 기능 테스트에 관한 것입니다.elementsByXYZ가 반환하는 요소에서 수행 할 수있는 작업은 무엇입니까?
elementsByXYZ 메서드는 요소 배열을 반환합니다. 나는 이러한 반환 된 요소에 대해 click() 메서드를 호출 할 수 있다는 것을 알았지 만 getAttribute (attributeName) 메서드를 호출 할 수는 없습니다.
a elementsByXYZ 메서드에서 반환 한 요소에서 호출 할 수있는 메서드 목록은 무엇입니까? 내가 그 볼 수있는 반면,
return this.remote
.get(require.toUrl("./testpage.html"))
.waitForCondition('ready', 5000)
.elementById('widget1')
.elementsByTagName('div')
.then(function(children){
assert.equal(7, children.length, 'The expected number of children is wrong');
for(var i=0; i < 7; i++){
console.log(children[i].getAttribute('className'));
children[i].click();
}
});
콘솔은 아이 [I] .getAttribute ('클래스 이름')가 정의되지 않은 반환을 보여줍니다 여기에
내가 달성하기 위해 노력하고있어 설명하는 코드이다 클릭이 각 아동에 대해 올바르게 수행됩니다.elem.getAttribute('class', function (err, text) {
console.log(text);
)};
wd.js를 사용하는 경우 :