How to run IE as a different user on UFT

Category:
Question ID: 109485
0
0

I am new to UFT. I am looking for some guidance. I want to “run as a different user” on IE. I need to be able to login to an account with higher rights for some tests. How would I go about doing this on UFT ?  

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on April 28, 2020 3:49 pm
7 views
Answers (1)
0
Private answer

Create a text file in Notepad with:

runas /user:<MachineName><LocalAdminLogon> /Savecred <C:pathapplication.exe>

Save the text file and then change the .txt file extension to a .bat file and run this by double-clicking on the file. The first time it is run enter the user's password in the cmd prompt

In UFT, use the following code to execute the batch file created above:

SystemUtil.Run "C:<filename>.bat", "","","open"

This will always then run the application as the specified user without prompting for credentials.

Further details:

https://ss64.com/nt/runas.html

Marked as spam
Posted by (Questions: 2, Answers: 425)
Answered on April 28, 2020 11:14 pm