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


Pretty sure that error means it didnt find anything with your XPATH, check it again.

You can also improve you xpath by making it more loose… i.e.

Got a inputbox named username

input[@name="username"] is all you need. It makes it easier for you in the long run if the site owner ever decides to change things up on the UI.

this is the thing i tried class xpath but still same error

You can try
CSS Selector

or XPath

Classes are not my favorite thing to match with because depending on site they can change on each load or if the site is updated those will also most likely change as well. Best to use parts that you know will always stay the same and by having a more general search it will look through the whole page for the matching element vs a single location link in your original xpath.