Highlighted
Adarsh Kumar GM
New Member.
778 views

How to make chrome browser run as administrator through VBscript/UFT

Hello All,

I am facing an issue. I have tried to run my script through UFT for Chrome browser, but unfortunately, it throws some "Generic Error". I was wondering if I can make my browser "run as administrator" through script. It might resolve the issue. I have tried to search a lot for ways to code to make my browser run as admin, but didn't get return any proper results.

UFT verison: 14.02

Chrome version: 65.033

Can anyone of you please help out.

Thanks.

Tags (2)
0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Re: How to make chrome browser run as administrator through VBscript/UFT

Hi there,

I see that this request has some time here.

About your question the only thing that I can think about now if to make your browser always to run as administrator.  For example, if you go to your browser icon > right click > properties > compatibility. Then check the option "Run this program as administrator"

chromeppts.png

Checking this option you will have your browser executed always with admin privileges. On the code you can use a SystemUtil.Run "chrome.exe"

Let me know if this is useful for you, also let me know more about the "Generic Error" that you are having.

Looking forward to your reply.

Regards,

Joaquin Viquez

0 Likes
Knowledge Partner
Knowledge Partner

Re: How to make chrome browser run as administrator through VBscript/UFT

You could try using Wscript from a batch file and executing the batch file from UFT, somethng like:

Option explicit 
dim oShell 
set oShell= Wscript.CreateObject("WScript.Shell") 
oShell.Run "runas /user:administrator ""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe""" 
WScript.Sleep 100 
oShell.Sendkeys "MyPW" 
Wscript.Quit

Change the path to your chorme install and the admin password

Mark Smith.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.