1
不执行我能够获得与下面的计数值:for循环量角器
element.all(by.options('type as type for type in types')).then(function(elems){
return elems.length;
})
.then(function(count){
cnt = count;
});
然后后面我想在使用cnt
for循环,我也用封闭代码:
for(var x = 1;x < cnt; x++){
search_options(x);
}
function test(y){
console.log('input'+y);
}
function search_options(input){
it('tess', function(){
test(input);
});
}
问题是for不执行。
任何提示或建议,指导表示赞赏或指出任何错误。 我已阅读关于IIFE,但我发现大多数样本使用阵列,我相信'cnt'已解决
不幸的是,我不得不使用for循环。 '每个'都不适合。
嗨,THX一堆,我会尝试一下,让你知道它是如何发生的。 – edm
嗨Alecxe,谢谢你的帮助。在'search_options(x)'中有几条语句,其中一条不执行/ resolve:'code' element.all(by.options('type as type for type in types'))。count()。then (function(e){ \te [input] .click(); }); '代码'任何帮助或反馈表示赞赏。 – edm
@edmond好,很难说,因为我没有办法重现你的问题。你确定循环应该从1开始而不是0?谢谢。 – alecxe