Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to close one of the browsers during runtime?
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
I am trying to write a note and save it in "yahoo note pad"

I logged in using my credentials. When click on Notepad. it opens another tab (notepad). I want to close thew previous tab. Tried several ways. Please help me with your invaluable suggestion


Code:
SystemUtil.Run("iexplore.exe"),"www.yahoo.com"
wait(3)
Browser("Micclass:=Browser").Page("Micclass:=page").WebElement("innertext:=Mail" , "html tag:=EM").Click
Browser("Micclass:=Browser").Page("Micclass:=page").WebEdit("html id:=username").Set "................@yahoo.com"
Browser("Micclass:=Browser").Page("Micclass:=page").WebEdit("html id:=passwd").SetSecure"..................."
Browser("Micclass:=Browser").Page("Micclass:=page").WebButton("html id:=.save").Click

Browser("Micclass:=Browser").Page("Micclass:=page").WebElement("innerhtml:=Notepad").Click

Two tabs in this stage.I want to close 1st one and work on current one(Notepad)
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Browser("CreationTime:=1").Close. Make sure the index of first tab. (You may get it from object repository).
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thank you buddy! You are great!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Maximize and Close a Browser mv8167 4 16,662 03-26-2023, 03:55 PM
Last Post: Mike B
  Close popup ad windows dustwynn 1 2,961 10-25-2016, 05:57 PM
Last Post: Ankur
  [UFT] Close opened folder robertosalemi 1 3,353 02-10-2016, 07:06 PM
Last Post: robertosalemi
  Close browser code not working akilamurugesh 1 4,640 08-26-2014, 03:21 PM
Last Post: vinod123
  Close on Exit Issue in QTP 11.0 EGBELL 1 3,209 02-02-2014, 03:39 PM
Last Post: EGBELL

Forum Jump:


Users browsing this thread: 2 Guest(s)