WEB - Chrome : Specified profile in the desired capabilities does not take effect

Operating System

Windows Server 2016 Standard

Katalon Studio version

version 8.6.0

Environment (for Web Testing)

  • Chrome 112.0.5615.87 (Build officiel) (64 bits)

Issue

In order to use a preset history and cache, we would like to launch a chrome session with a specific profile. (The profile is already created and available).

We’ve set the following prefs in the desired capabilities menu :

  • user-data-dir ==> path to the data directory
  • profile-directory ==> profile name

When launching the test case, katalon seems to note take into considération those settings.

the chromedriver start with this arg instead --user-data-dir=“C:\Program Files (x86)\scoped_dir10120_1882402140” which is a temporary folder for that execution.

to get things done, i’ve had to write the following code :

def profilePath = 'C:\\Users\\Administrateur.WIN-5LV44M17JV8\\AppData\\Local\\Google\\Chrome\\User Data'

def profiledir = 'Profile 1'

System.setProperty('webdriver.chrome.driver', 'C:\\ProgramData\\Katalon_Studio_Windows_64-8.6.0\\configuration\\resources\\drivers\\chromedriver_win32\\chromedriver.exe')

ChromeOptions options = new ChromeOptions()

options.addArguments('user-data-dir=' + profilePath)

options.addArguments('profile-directory=' + profiledir)

WebDriver driver = new ChromeDriver(options)

DriverFactory.changeWebDriver(driver)

and finally managed to launch chrome with selected profile.

Could you please tell me why setting the profile in the desired capabilitites menu does not take effect ?

Here is the log when launching the TC

User set preference: [‘prefs’, ‘{download.default_directory=C:\Users\Administrateur.WIN-5LV44M17JV8\Desktop\Fichiers Katalon\Download, prompt_for_download=false, safebrowsing.enabled=true, user-data-dir=C:\Users\Administrateur.WIN-5LV44M17JV8\AppData\Local\Google\Chrome\User Data, profile-directory=Profile 1}’]

Thanks in advance

Hi @yassine.nejjar

Can you please add a screenshot of your Desired Capabilities menu with the settings you entered there?

So that I can see how you entered the fields.

I use the Desired Capabilities menu and my setting do take affect as below

Hello @jmeintjesn7,

You can see in the desired capabilities, that i have exactly the same values (user-data-dir and profile-directory) as those written in the code.

and katalon seems to take into considération those settings only when it’s written in the code.

Thanks you

There is another thing you could try. This is to add the capabilities to the Chrome (headless) as well. It might be running on the Chrome (headless) driver

Also what helped me is to directly edit the desired capabilities file in a text editor:

Location:

Headless Chrome driver
{directory to katalon project}\settings\internal\com.kms.katalon.core.webui.chrome (headless).properties

Chrome driver
{directory to katalon project}\settings\internal\com.kms.katalon.core.webui.chrome.properties