在为网站编写自动化测试时,我得到了以下非常奇怪的错误,这里是相关的代码行:
68 let selected
69 if( params.includes('-RB') ){
70 let books = Selector('.actions > .link-learn > div').withText('VIEW PRODUCT')
71 const index = books.count
72 selected = books.nth( Math.floor(Math.random() * index) );
73 }
testcafe 在第 72 行提出以下投诉。
"index" argument is expected to be a number, but it was number.
并且在我的程序中没有以名称编号命名的字符串、变量等。那么这个错误是什么意思,也许这个错误应该抛出一个稍微更清楚的不同消息。
谢谢