Micro Focus QTP (UFT) Forums

Full Version: How to execute RunAs command in QTP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The AUT opens as Loggged on user. But I want to invoke the AUT as different user and run my BPT. I tried creating the below VB script but what is happening is when I run the VBS from QTP, AUT opens but QTP is recognising AUT as window object instead of Web. Any idea to get rid of this?

VBS Code
Code:
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "runas /user:<UserName> ""c:\Program Files\Internet Explorer\IEXPLORE.EXE <AUT URL>"""
WScript.Sleep 1000
oShell.Sendkeys "<Password>"
Wscript.Quit
I didn't get that... why don't you simply record the login screen and replay whenever required...whats the problem you are facing in that case?
Ankur,
Actually the AUT logs in with logged in system user credentials. There will be no login box for the AUT. To run my script for different users i need to log in as different user and it is not feasible to get installed QTP in all those users profile and test. Appreciate if there is any other approach to do that.

Thanks,
Ashok