Micro Focus QTP (UFT) Forums
Want to open a new browser window with new session - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Want to open a new browser window with new session (/Thread-Want-to-open-a-new-browser-window-with-new-session)



Want to open a new browser window with new session - umer830 - 01-14-2010

[/b]I want to work with multiple application users during a run session of QTP
say user A and user B

I am using below code to creat another IE window and login as user B. below is my code

Code:
set objexpl = CreateObject("InternetExplorer.Application")
    objexpl.visible = true
    objexpl.navigate "https://projectcentre.net/QTP"

Problem with this code is that it opens a new broswer window but rather opening home page to login it carries the existing user session i.e. user A session and takes to first page directly without login.

if I use other ways like
'SystemUtil.Run "iexplore.exe", "https://projectcentre.net/QTP"
it takes me to login page but problem is I can't get the browser object this way, So that I can manipulate different object on login page using descriptive programming

Waiting for your help as its little urgent for me


RE: Want to open a new browser window with new session - satan - 01-18-2010

dynamically get the browser objects.
Code:
Set objB= Description.Create()  
                objB("application version").Value ="{BrowserVersion}"

        Set p_objBC = DeskTop.ChildObjects(objB)  
                intB= objBC.Count
' Get the number of IE browsers opened on Desktop and loop through them to get your handle for the new browser window.