testingbrowserinput-field

How to provide the automatic input for the browsers on page loaded only for testing purposes?


AFAIK under some condition the browsers could automatically fill the input fields once browser have load (not once the user has began the input). Personally I don't use this feature, but I need to test it from the development targets.

How I can active this feature?


Solution

  • To use auto-fill settings from browser you need the values to exist in the user profile that the browser is using. Then, in case you use webdriver based automation like Selenium you need to point it to that profile and start the browser this way. For example, this post explains how to start chrome with certain user profile:

    https://superuser.com/questions/377186/how-do-i-start-chrome-using-a-specified-user-profile

    It uses the cli, but the same can be achieved using any of the supported languages.

    If you only aim to test this manually, then once the data is saved on your profile, it will be 'auto-filled' on pages that fulfill the criteria. Those criterias vary depending on the browser being used, for example chrome uses regex matching, which is explained in this answer by kmote:

    first name: "first.*name|initials|fname|first$"

    last name: "last.*name|lname|surname|last$|secondname|family.*name"

    email: "e.?mail"

    address (line 1): "address.*line|address1|addr1|street"

    zipcode: "zip|postal|post.*code|pcode|^1z$"

    How to trigger Autofill in Google Chrome?