我试图以有序的方式将数据存储在数组中,这里是我试图逐行使用DOM获取的代码,问题是getText()是异步函数而执行不在我希望,当then()调用?
时,如何访问counter1的正确值?for(var counter1 = 0;counter1<length;counter1++) {
rows[counter1].all(by.css("div:nth-child(1)")).getText().then(function(row){
arr[counter1] = row; //the value is the length for all calls
});
}