Reputation: 3
I've created the variable randomSixNum whose result is 6 random numbers and i want to pass it to puppeteers page.type method.
***let randomSixNum = Math.floor(Math.random()*89999+100000);
await page.type('#developer-name', randomSixNum)***
The issue i am having is that i keep getting the error ( Type Error: text is not iterable)
I know that randomSixNum definitely returns 6 random numbers, so my suspicion is that the page.type method doesn't accept numbers?
Upvotes: 0
Views: 353
Reputation: 71
Indeed. Converting randomSixNum
to a string fixes the issue.
let randomSixNum = Math.floor(Math.random()*89999+100000);
await page.type('#developer-name', randomSixNum.toString());
Upvotes: 1