| || |
QTP & Internet Explorer Run As Functionality
I have been working on an application that has different permission levels for different set of users. I am trying to automate this for our testing purposes.
What I need to do is login into this application (web based) by logging into Internet Explorer as one of the test users and see what permissions I have. Manually I can do that by Right-Clicking on the IE icon and picking Run As... and then pick "The following User :" and provide the test username and password and then the new IE window that opens recognizes the new test user. I can record all these operations perfectly fine with Windows Application option selected in Record & Run Seetings. But when I try to playback the script it says it doesnt recognize the object. Can anyone help? Is there a work around this. I even tried to do this by remoting into another machine as a test user but QTP doesnt recognize recording on a remote pc either.
Following is the script I get when I record my steps but it fails at the very first step during playback. I am using Web and ActiveX add-ins. I tried this even with only ActiveX add in. Let me know if anyone can help.
Window("Window").WinToolbar("Quick Launch").WinMenu("ContextMenu").Select "Run as..."
SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","","C:\Documents and Settings\apanjwani","runas"
Dialog("Run As").WinRadioButton("The following user:").Set
Dialog("Run As").WinEdit("User name:").Set "SHERMAN\username"
Dialog("Run As").WinEdit("User name:").Type micTab
Dialog("Run As").WinEdit("Password:").SetSecure "password"