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

this is a common problem created by dumbass product owners, they cannot understand that the tester must have full controll of the testing environment in order to produce accurate test results
othwrwise,as a last resort,we can do ‘extensive blind testing’. and god have mercy on them sorting the bug reports
@Madhuri i had once a similar issue. i just made a story defect, sort of ‘feature failed testing due to no relevant access for testing team to the environment’.
2nd day i was granted with admin rights on whatever i need :smiley:

@kazurayam
Yes. They do give me access for QA for user ‘test01’ with Default Profile but I dont have permission to check the items in profile path.

Steps followed as per my requirement:

  1. I have to run as different user on Chrome browser and logged in using profile with username as ‘test01’ and password as ‘xxxxx’
  2. It opened a new chrome instance and once i hit the testing url again it opens a alert box to enter the profile credentials so after i enter them i can access the site with that specific user profile.

I need some way to automate the above procedure to execute my scripts in Katalon otherwise the scripts will be of no use :frowning:

So you want to somehow automate entering the credential into the alert box. The alert box is possiblly Chrome native, nothing to do with HTML.

I have never seen it. Really I do not have idea what. But I guess, it is out of the scope of Katalon/Selenium UI automation capability which is all about HTML DOM operation.

I remember, several months ago, @Russ_Thomas mentioned about a tool (sorry I forgot the name) which enables you to automate any UI operation on Windows, and possible useful for Madhuri. I would invite him to join us here.

@kazurayam winium?
@Madhuri see https://github.com/2gis/Winium

Any tool which supports windows UI operation is fine but are those scripts can be integrated with Katalon.

I have done all the scripting in Katalon so pls suggest a way to integrate with the Window operation and then execute the groovy scripts using the same browser session

there are some topics on this forum on how to use winium with katalon
e.g

No.

Possibly, AutoHotKey,

Russ once said he uses AutoHotKey a lot

I don’t know AutoHotKey at all.


Do you want to execute AutoHotKey as a part of Katalon Test Case?

Once I posted a Test Case example which executes Windows dir command.

You can execute any commands by this method. Possible you can execute AutoHotKey script as well.

Ok. Will give it a try though i’m also very new to this tool.

You can, yes. But I think some explanation is in order.

AHK hooks into the windows subsytem to monitor keyboard and mouse operation. When it receives a specific key or set of keys or a string it recognizes, it executes a predefined operation. IOW, it’s a macro system.

Aside: My description makes AHK sound like a simplistic macro player. Not true. It’s *much more than that. It’s quite complex and extremely powerful in the right hands.

The problems I see are:

  1. It’s a lot to learn to solve the OP’s problem.
  2. AHK “just sits there waiting”. It’s not designed to be “called” like other subsystems/programs.

If we assume you have managed to start AHK from Groovy code, you would then need to trigger the right keys in Groovy which target the browser to trigger the right macro in AHK (because it’s waiting for those keys).

Sounds messy.

I’m not saying it won’t work. Just sounds tricky - and there are too many moving parts.

https://autohotkey.com/docs/Program.htm

Hi @kazurayam and @Russ_Thomas, Thanks for your guidance.
Actually my client doesn’t support installing other softwares except Katalon which i’m currently using for Test Automation. So i have been searching for the solution for the past few days and got it from the below source.

I’m able to to run chrome as different user using java code but as you see from the above source there is no driver initialization or such. So could you please let me know if there is any way as how to tell Katalon to use the browser opened by the Java code.

Thanks for the help!!

Does anyone can help me on this?

I am sorry to say but I still do not understand your problem. Could you please take screenshots of the following procedure you mentioned, step-by-step?

I would need screenshots of all the following steps:

  1. you “ran as different user on Chrome” ---- screenshot 1
  2. “logged in using profile with username as ‘test01’ and password as ‘xxxxx’” ---- screenshot 2
  3. “it opened a new Chrome instance” ---- screenshot 3
  4. “once i hit the testing url again it opens a alert box” ---- screenshot 4
  5. “to enter the profile credentials so after i enter them i can access the site with that specific user profile” ---- screenshot 5

Please give concrete names of “user” and “profile” you use. please distinguish Windows OS-level user and Chrome user profile. I can not see which one you are refering to when you write a word “user”. Screenshots will tell us about it.

The screenshot for the above:

Below alert or pop up appears when i click on SSO login button

Below is the final destination page where i need to start testing after clicking sign in on alert box

How do you run chrome.exe as different user?

I read https://winaero.com/blog/run-app-different-user-windows-10/ and I found one way like this.

  1. Open Windows Explorer, navigate to the folder where chrome.exe is located (possibly C:\Program Files (x86)\Google\Chrome)
  2. Press and hold Shift key, and right-click on the chrome.exe file
  3. In the context menu, select Run as different user .

Do you do the same steps?

The following article seems to be relevant:

https://www.gerbenvanadrichem.com/quality-assurance/how-to-get-selenium-to-run-the-browser-as-a-different-user/

Selenium Grid, RemoteWebDriver, … it’s a super complexed scenario. I don’t think I can try it.

I just select Google chrome icon on the desktop and then press and hold shift key and right click.
It gives run as different user option then i follow the steps as shown in the screenshot.

I have seen this but seriously I dont understand the process he followed :frowning:

@Madhuri,

I suppose you should take the suggestion by Ibus seriously applying to you.

Yeah i told them but then after few days again they came back to me asking me to try with other possible solutions to fix this.