Forum Discussion
dmiscannon
Frequent Contributor
The above article provides how to check if the browser is still open and to close all open browsers, both from keyword and script tests. Add these steps to you test and see if it helps when running them from TestExecute.
djadhav
9 years agoRegular Contributor
I add all the browsers I use for testing to the TestedApps section. The at the end of every test I run this routine to close the browsers as required.
'closes the tested browser FUNCTION lib_closeBrowser(browserType) DIM testedAppIndex testedAppIndex = TestedApps.Find(browserType) 'find index of the tested browser IF NOT (testedAppIndex < 0) THEN Log.Message("Closing browser : " & browserType) IF Sys.WaitBrowser(browserType,3000).Exists THEN TestedApps.Items(testedAppIndex).Close END IF IF Sys.WaitBrowser(browserType,2000).Exists THEN TestedApps.Items(testedAppIndex).Terminate END IF IF Sys.WaitBrowser(browserType,1000).Exists THEN CALL kill_Browser(browserType) END IF ELSE Log.Error("Closing browser : " & browserType & " : ERROR: Application not found") END IF END FUNCTION 'CALL function like this lib_closeBrowser("iexplore") lib_closeBrowser("chrome") lib_closeBrowser("firefox")
- smartbutton9 years agoOccasional Contributor
Thank you for your input
Related Content
Recent Discussions
- 4 hours agoSvetaG