Micro Focus QTP (UFT) Forums
closing the browser - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: closing the browser (/Thread-closing-the-browser)



closing the browser - diya - 11-26-2012

hi ,

i was trying to close the browser after specific action is done and not able to do it.

I am using with Gmail login to show what iam trying to do

Code:
systemutil.Run "iexplore.exe","www.gmail.com"
If browser("name:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").WebEdit("name:=Email").Exist Then

browser("name:=Gmail: Email from Google").Page("title:=Gmail: Email from Google.*").WebEdit("name:=Email").Set datatable.Value("username","Global")
browser("name:=Gmail: Email from Google").Page("title:=Gmail: Email from Google.*").WebEdit("name:=Passwd").SetSecure datatable.Value("Password","Global")
browser("name:=Gmail: Email from Google").Page("title:=Gmail: Email from Google.*").WebButton("name:=Sign in").Click
End If
'browser("name:=Gmail: Email from Google").Page("title:=Gmail: Email from Google").link("name:=No thanks").Click
browser("name:=Gmail - Inbox").Page("title:=Gmail - Inbox.*").Link("name:=Sign out").Click
browser("name:=Gmail: Email from Google").Page("title:=Gmail: Email from Google.*").Close
and also while doing it i faced again issue of upgrading IE to google and we have to click No thanks but its for first time.Next i dont see that how to handle those in code.Please explain


RE: closing the browser - K Gaurav Varshney - 11-27-2012

Hi,
You may use another IF statement to check the existence of 'No Thanks' link and if it exist then click on it.

Regards,
K


RE: closing the browser - kalaivanan123 - 11-27-2012

For Closing the application Just give the code like below one in the final line,

Code:
Browser("name:=Gmail: Email from Google").Close



RE: closing the browser - diya - 11-27-2012

Thanks Got it..

Can you please check my split fn and explain me ...i have created a thread no one is answering