Expected at least 2 elements to be found but 1 were found PuppeteerTypeElement error

Hello there, i got this error when i try to type user & password, for some reason it takes the first typeElement username but not the second which is the password, i tried doing the same with OB1 and it does work.

[Executing block Pass] Exception: Expected at least 2 elements to be found but 1 were found

BLOCK:PuppeteerTypeElement
LABEL:User
  findBy = XPath
  identifier = "//*[@id=\"username\"]"
  text = @input.USERNAME
ENDBLOCK

BLOCK:PuppeteerTypeElement
LABEL:Pass
  findBy = XPath
  identifier = "//*[@id=\"password\"]"
  index = 1
  text = @input.PASSWORD
ENDBLOCK
Browser opened successfully!
>> Navigate To (PuppeteerNavigateTo) <<

Navigated to https://*************/account
 
>> Click (PuppeteerClick) <<

Clicked 1 time(s) with Left button

>> User (PuppeteerTypeElement) <<

Typed ****************

>> Pass (PuppeteerTypeElement) <<

[Executing block Pass] Exception: Expected at least 2 elements to be found but 1 were found

BOT ENDED AFTER 7744 ms WITH STATUS: ERROR 

Does anyone know what’s wrong?

Remove the line saying index = 1 in the second element and it should work, since there cannot be 2 elements with the same id on a page. As you see from the error message it found one. Index starts at 0 not at 1.

1 Like

That was it, thank you !

1 Like