1

Is possible to use Autocomplete (Google Chrome autofill feature) in Puppeteer?

This feature is not mentioned in the official Puppeteer documentation

  • 1
    If you're tring to automate the username and password input, maybe you can write them in a CSV file. And let puppeteer and node.js read them while running. – Edi Imanto Dec 28 '19 at 19:46
  • The closest I could get was to get the autocomplete menu to show, but I could not, no matter what sequence of key presses I tried, get the autocomplete option to be selected. I think this may not be possible. Here is my repo, in case anyone else wants to continue this effort: https://github.com/douglasnaphas/puppeteer-autocomplete. – Doug Naphas Jan 01 '20 at 21:34
  • I guess there are security reasons for not allowing it. Perhaps build into chromium itself. – The Fool Jan 03 '20 at 21:06

1 Answers1

0

The autofill/autocomplete widget cannot be interacted with via automation. This restriction is a security measure considering that the widget presents an interface for accessing critically sensitive information such as credit card data. The widget cannot be access via DOM interfaces and cannot be styled.

Moreover, testing the autocomplete/autofill feature absolutely adds no value to the quality process. Focus your tests on data generated by your application and components you actually developed.

The source of the suggested values is generally up to the browser; typically values come from past values entered by the user, but they may also come from pre-configured values. For instance, a browser might let the user save their name, address, phone number, and email addresses for autocomplete purposes. Perhaps the browser offers the ability to save encrypted credit card information, for autocompletion following an authentication procedure.

~ The HTML autocomplete attribute

Igwe Kalu
  • 14,286
  • 2
  • 29
  • 39