While automating Tests on Testsigma, sometimes, it might be required to perform the Tests with special Browser Settings such as installed extensions, locale, language e.t.c. In such cases, the best way to fulfill the requirement is using User Profiles in Chrome.
Create a new profile, Customize it as per your requirements by installing required extensions and changing the settings. After that, you can select the profile using Desired Capabilities in Testsigma.
Steps for using Custom User Profile in Testsigma
1. Finding your current Profile path
2. Making changes in Profile folder
3. Using the Desired Capability
1. Finding your current Profile path
While Executing, you can check the current Profile location by going to the following URL:
chrome://version
Default location of Chrome Browser Profile for different OS
OS | Profile Path |
---|---|
Windows 7, 8.1, and 10 | C:\\Users\<username>\AppData\Local\Google\Chrome\User Data\Default |
Mac OS X El Capitan | Users/<username>/Library/Application Support/Google/Chrome/Default |
Linux | /home/<username>/.config/google-chrome/default |
Workaround to use user-defined profile for Executing Tests on Testsigma
We could use the --profile-directory argument for specifying the User Profile. However, due to a known bug in Chrome, you might need to do the following workaround and use the --user-data-dir argument.
2. Making changes in Profile folder(workaround)
1. Open your default File Explorer (Windows Explorer - Windows, Nautilus - Linux and Files - Mac) and navigate to the location - ex: C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Profile 1.
2. Create a folder named 'Default' there and copy the contents of 'Profile 1' directory deselecting the recently created 'Default' folder.
3. Paste the copied contents inside 'Default' folder.
After that, you can use Desired Capability in the following format for using User-defined profile in Testsigma. The following Desired Capability can be used to start Chrome Browser during an automation session using user-defined profile.
Name | Data Type | Value |
---|---|---|
goog:chromeOptions | String | {"args":["user-data-dir=/path/to/your/custom/profile"]} |
3. Using the Desired Capability
Check the below article for more details on using Desired Capabilities in Execution Configuration - How to use Desired Capabilities in Testsigma?
Happy Automation Testing!