I have 2 browsers open presently having the same title and I want to close the second or first browser using QTP Tool?
Thanks in advance.
I have 2 browsers open presently having the same title and I want to close the second or first browser using QTP Tool?
Thanks in advance.
Why don't you select the option of"close the browser when test close".
Or record the same action in QTP recording, QTP will do it for you.
Regards,
Brijesh Jain
---------------------------------------------------------
Connect with me on Skype: jainbrijesh
Google Plus : jainbrijeshji
if Browser("index:=0").Exist(2) then
a = Browser("index:=0").close 'It will close 2nd browser
end if
Rajaputra,
I would like to kno how does this work... ?
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.
-sutnarcha-
simple
browser("index:=0").exist means to confirm that whether the particular browser is already opened or not. So that we can close.
Here index =
- 0 means recently opened browser
- 1 means recent but one and so on
nice Solution,
This is the only way to distinguish between two browsers which has the same name still sometime its really dificult to distinguish and it closes the wrong wondow .
M still working on this to get a robust solution if anybody has ne suggestion then they can help me out.
Hai friend,
Just use this script
If Browser("CreationTime:=1").Exist then
Browser.close
End If
Thanks
Deepa
Try this:
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
IE.Navigate strAppUrl
While IE.Busy
Wend
It worked for me