Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opening Multiple Browsers Simultaneously using QTP
#1
Not Solved
Hi ,

I am working on a Siebel Application and I want to open multiple browsers( eg=10 browsers) simultaneously using QTP having same url but having different User Name and Password to complete my task .

When I use loop , it does open multiple browsers but only one browser opens as Siebel application and the remaining as other browsers which is not required by me .I guess it is the lack of unique property which QTP fails to identify .

How do i make use of creation time of browsers here to identify each siebel application .Any suggestions ??

Regards,
Faisal
Reply
#2
Not Solved
Use it this way,
maybe a rough code, alter to your needs...
Code:
For i = 0 to 10
    
    Browser("CreationTime:="&i).Navigate Datatable("urlpath")
Next

Store your Url's in the Datatable and then input it one by one into the for loop. As i said it is very rough, please alter it to your needs. The base concept remains intact.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
For Opening Multiple Browsers Simultaneously , I am using For Loop to open the browser multiple times.The browser in my case is my Siebel Application.

Then I use another for loop and set the current row of DataTable in which I have provided different User Names and Passwords which I need to use to login to my siebel application multiple times which I open using 1st For loop.

I am able to login to my Siebel application with user name and password as provided in DataTable but it does not take user name and password for next opened browsers .Any Suggestions??

Regards,
Faisal
Reply
#4
Not Solved
you can use a single for loop to open a browser and within that loop you can login to application as in the datatable.

Reply
#5
Not Solved
Hi,

I have tried with Single For loop also but there was no success . Please find the details of my approach which i had used before using a Single For loop to open browsers and login to application :

My Approach :

It takes the User name and password for the first browser and logs into it , but it does not take the user name and password for the other web browsers .I have stored the user name and password in the data table and using for loop I am logging to the browser. Please find the details below:

Note: It is the same browser which i need to open multiple times using different user name and password.

1) I am opening my multiple browsers with the below concept :

Code:
For i = 0 to var_RowCount

Set oIE = CreateObject("InternetExplorer.Application")

oIE.visible=true

oIE.navigate "URL"   ------ have provided the url of my web browser

Next

2)Next I am setting the current row of data table in a for loop to traverse through the loop and complete my actions . But it does not allow me to log in to next browsers as it does not take user name and password from the data table (it still shows the focus on first row of data table).I am using below concept for this :

Code:
For i = 0 to var_RowCount

DataTable.SetCurrentRow (i)

Browser("index:=i").Page("title").WebEdit("name:=SWEUserName").Set DataTable("User_Name", dtGlobalSheet)

Browser("index:=i").Page("title ").WebEdit("name:=SWEPassword").Set DataTable("Password", dtGlobalSheet)

Browser("index:=i").Page("title ").Image("name:=Image","repositoryname:=LoginButton").click

wait(10)

Next

Note:
1)How else can I make the focus to the next rows of Datatable other than using DataTable.SetCurrentRow (i) in a for loop.
2)Or how to get the focus to next browsers after logging into first browser.

Regards,
Faisal
Reply
#6
Not Solved
using creationtime instead of index should solve the issue
e.g.
Code:
Browser("CreationTime:=i").Page("title").WebEdit("name:=SWEUserName").Set DataTable("User_Name", dtGlobalSheet)

Reply
#7
Not Solved
I agree with saket solution because while handling multiple browsers it would be better go with creation time as ordinal identifier
Thanks saket for refreshing me about this...
Reply
#8
Not Solved
My hunch states that there is a issue with the syntax. I am not sure if it is a typo from your end but passing variable would be like,

Browser("index:="&i)

As saket & Venkat have mentioned, creationtime is the right approach, however i see saket also mentioned it as ,

Browser("CreationTime:=i") and i believe Browser("CreationTime:="&i) should be the right one.

Correct me if i am wrong saket & Faisal.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#9
Not Solved
Good catch Basanth, Thanks for pointing out.

Reply
#10
Not Solved
First of all Thanks for your support.Basant You are correct and it is the way it should be .Thanks!

I tried with both Index as well Creation time property , though it holds good when we script as Browser("CreationTime:="&i) .

However I am able to log into the application with the first user name and password as provided in the datatable.It then goes to next row in the datatable .

On reaching to the statement :
Code:
Browser("CreationTime:="&i).Page("title:= ").WebEdit("name:=SWEUserName").Set DataTable("User_Name", dtGlobalSheet)
, it does not proceed further as it throws an error :

”You already have a Web Browser accessing the current Web Session.Multiple Browsers are not allowed to share the same web session.To launch a new web session , please open a new web browser by accessing your command prompt or your desktop .

On Reaching this Statement :

Code:
Browser("CreationTime:="&i).Page("title:=Mobily CRM - Integration").WebEdit("name:=SWEUserName").Set DataTable("User_Name", dtGlobalSheet)

It gives Runtime error … Cannot find WebEdit object’s parent[Browser]


Sorry I am unable to attach File as an attachment herebecause of difficultiy in attaching here .
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Automation Testing On Beta Version of Browsers manmayee 1 1,856 07-31-2016, 01:19 PM
Last Post: Ankur
  .Net Framework 4.0 application crashes after opening QTP 11 Deepa William 0 2,554 08-29-2013, 06:01 PM
Last Post: Deepa William
  QTP11 not correctly identifying the count of open IE8 browsers vaibhavonlearnqtp 0 2,055 10-16-2012, 09:35 AM
Last Post: vaibhavonlearnqtp
  QTP Scripts run through QC on multiple remote hosts DKHacker 0 3,510 08-22-2012, 06:53 PM
Last Post: DKHacker
  QTP opens 2 browsers automatically without expectation hoangph 0 2,356 06-27-2012, 09:27 AM
Last Post: hoangph

Forum Jump:


Users browsing this thread: 1 Guest(s)