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