Typescript - 函数被跳过

Typescript - function get skipped

以下函数在所有情况下的调试中都会被跳过。 我真的说不出原因。 没有东西从 catch 块中抛出。 在调试时,我立即到达 catch 块之后的最后一行。 感谢您的帮助。

  public async Function(licence:string,stepDescription) {
    try{
        let count:number = await this.doctorsLicenceNumbers.count();
        let checked:boolean = false;
        let doctorRefernceFromWeb;
        for(let i=0; i < count; i++) {
            doctorRefernceFromWeb = await this.doctorsLicenceNumbers.get(i).getText(); 
            if (doctorRefernceFromWeb == licence) {
                checked=true;
                await this.doctorsReferncesCheckBoxes3.get(i).click();
            }
        };
        }
            
    }catch(e){
        console.log("function failed error is: " +e);
    }
}

最后,解决这个问题的方法是将对象从 elementArrayFinder 转换为 elementFinder 数组。 谢谢大家