Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to execute RunAs command in QTP?
#1
Not Solved Question 
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
Reply
#2
Not Solved
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?
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to catch the script execution when QTP scripts are executed from command line Sreeni.lutukurthy 0 2,696 03-19-2015, 05:55 PM
Last Post: Sreeni.lutukurthy
Wink How to read text in command prompt using QTP Sourabh146 1 6,359 11-30-2013, 11:02 AM
Last Post: ravi.gajul
  Clicking command button in accesss form mark_cielos24@yahoo.com 1 3,184 05-07-2013, 10:52 PM
Last Post: agarwl.anurag
Question <Interesting> Is it possible to execute SAP GUI application without QTP Jyobtech 3 3,461 09-07-2012, 12:26 PM
Last Post: SIBICA
  how to run QTP scripts from command line prompt? pra6201 1 18,008 01-03-2012, 08:46 PM
Last Post: ravi.gajul

Forum Jump:


Users browsing this thread: 1 Guest(s)