While installing Google Chrome, it creates a default profile folder in your local drive that saves info like bookmarks, passwords, user preferences and some other settings. You can have multiple Chrome profiles, each containing a separate set of user information. Let's say there are two users who are using same computer, and both wants their own Chrome settings then both users can create & access their own Chrome profile whenever they open Chrome browser.
When Chrome is launched with Selenium WebDriver, certain plug-ins, extensions, bookmarks etc. are not available. It opens a blank Chrome browser. Sometimes we need these plug-ins, extensions etc. while executing selenium test case.
To enable the usage of these different bookmarks, have separate extensions, plug-ins etc. Chrome's profiles system comes handy. Multiple profiles can be created on a system, each profile having its own bookmarks, settings, add-ons, browser history, cookies, and other data.
What is the need of creating custom Chrome profile?
- Many times, we require some special settings in Chrome profile just to make test execution more reliable. The most common example is a SSL certificate settings or browser plug-ins that handles self-signed certificates. For these kinds of requirements during test execution, we need to create custom profile that can easily handle this requirement & make test execution more reliable.
- Every time if you use different profiles, the SSL certificates you accepted or the plug-ins you installed would be different and that would make the tests behave differently on the machines.
- Always make sure that the profile you have created must be of very lightweight that only includes those plug-ins, extensions, settings which are required in test execution. Whenever selenium starts, a new session is created for Chrome instance that copies the entire profile in some temporary directory and if the profile is big, it makes it slow & unreliable.
Google Chrome allows you to manage profiles while it’s running. To access this feature, go to Google Chrome and navigate to settings after clicking on the vertical ellipsis. In settings, click on 'Chrome name and pictures' section under the People category.
This will expand this category and you will be able to select a new avatar for your profile and link it with some google account.
You can verify the profile that by navigating to 'chrome://version/'. This will provide the details of the profile that you are using currently as shown in the screenshot below:
Chrome stores its information about the different profile that have been created till now in the below folder:
- C:\Users\<user>\AppData\Local\Google\Chrome\User Data\<profile>
How to create a new profile in Chrome:
1. To create a new profile, you can click on your current profile and navigate to Manage People as shown below
2. This will take the control to a new popup where you can create a new profile by clicking on the Add person as show below
3. You can select a new avatar and create the profile by providing a descriptive name for the new profile, so you can remember what it’s for. For example, you might name it “Selenium Test” if it’s for some selenium tests as shown below
Note: To use the profile that you have created above, make sure that all the instances of the chrome browser that are opened using some other profile should be closed before executing the Start Web Browser building block.
To use this profile inside LEAPWORK, specify the profile path in Start Web Browser Block inside the user profile property. The Browser window that it will launch will be as per specified profile.
For any clarification, please contact our Priority Support.