Run Chrome with a different user than the one who started Katalon


#1

Hello,

Actually, when I run a Test Suite in Katalon, it seems the web browser is started with the same user who started Katalon. In my company, we have to start Katalon with admin rights so Chrome is started with admin rights. But for proxy authentication reasons, the Web access are not the same compare to the normal user doing the test manually in the browser ( for example the Google APIs are not reachable ).

I tried ugly things with Keywords or Listerners starting Chrome with runas or psexec, it’s not working very well.

How can I change the Chrome settings to run it as the legacy user and not the admin user who started Katalon ?


#2

Try to experiment with user permissions for chromedriver.exe
Maybe this article will help you https://www.digitalcitizen.life/take-ownership-and-change-permissions-files-and-folders

Other way, you can write a bat file with following code: runas /user:Bob “chromedriver2.exe”
Convert that file from bat to exe, change name to chromedriver.exe and from now on Katalon probably will use this file to start chromedriver2.exe (original file)

Not sure if this will work, but you can try :wink:


#3

Thank you Mariusz for your reply, unfortunately it seems the settings for the chrome driver are not what could solved my problem.

I already test with the runas, but I have to type the password of the legacy user in the batch prompt and unfortunately it’s impossible to do it without a web browser opened. For example this is not working :

WebUI.sendKeys(null, “password”) // type the password
WebUI.sendKeys(null, Keys.chord(Keys.ENTER)) // valid the command prompt to start Chrome

I tested too the psexec downloaded from here : https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

And with a command like this : psexec \computername -u domain\user -p password “chrome.exe”

But it’s not very proper and I have now a problem of password management inside the company.


#4

Or maybe you would run Katalon in a virtual machine?


#5

why do you need to run katalon with admin rights?
for me is running just fine as simple user


#6

In my company policies you’re not able to run software until you have a dedicated admin account.

I actually solved my problem by pushing Katalon on the white list of software of my company, it can be started with a normal user. And now chrome is started with the same user and the behaviour is ok.


#7

Any update on this?
I want to run the browser as different user for my testing.


#8

Hi, no update since I created the Topic.


#9

Thank you, so how you are doing your testing now.I could find .net impersonation code but not sure how that will work in katalon(groovy) if i do some modification .


#10

As a good user of Ranorex I tried the same approach, I tried to translate my C# code into Java / Groovy but I was not able to to something regarding the Policy of my company in term of security.

This is the workaround as described in my previous Post :

I actually solved my problem by pushing Katalon on the white list of software of my company, it can be started with a normal user. And now chrome is started with the same user and the behaviour is ok.


#11

Could you please copy the java/groovy code here.Thanks in advance


#12

As said before, my code to launch an external application ( from Katalon ) wasn’t really working due to the security policy of my company. I solved my problem by adding Katalon to the white list of my company and now I can launch it with a normal user then Chrome is started by the same way.

BTW if you’re looking for some Java code allowing you to start a process :

import java.io.*;
Process process = new ProcessBuilder("C:\\PathToExe\\MyExe.exe","param1","param2").start();