在 Puppeteer 中使用自动完成

问题描述:

是否可以使用 Autocomplete(Google Chrome 自动填充功能)在 Puppeteer 中?

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

官方Puppeteer中没有提到这个功能文档

This feature is not mentioned in the official Puppeteer documentation

无法通过自动化与自动填充/自动完成小部件交互.此限制是一种安全措施,因为小部件提供了一个用于访问信用卡数据等关键敏感信息的界面.小部件无法通过 DOM 接口访问,也无法设置样式.

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.

~ HTML 自动完成属性>