1
我正在使用我的實習生功能測試中的一組按鈕,我希望能夠按順序對每個按鈕進行測試。我的頁面看起來像下面這樣:實習生功能測試 - 在一組中按順序點擊按鈕
<input type="button" text="Button 1" class="myBtn">
<input type="button" text="Button 2" class="myBtn">
<input type="button" text="Button 3" class="myBtn">
而且我的測試如下:
return remote
.findAllByClassName('myBtn')
.then(function(btns) {
var btn1 = btns[0];
return btn1;
})
.click()
.end()
.then(function(btns) {
var btn2 = btns[1];
return btn2;
})
.click()
.end()
.then(function(btns) {
var btn3 = btns[2];
return btn3;
})
.click()
.end()
.end()
什麼是做這種類型的使用實習生迭代測試的正確方法?
有趣的想法,似乎運作良好...是有一個原因一個簡單的for循環在這種情況下不起作用? – emroc
由於呼叫是異步的。 –