Forum Discussion
djadhav
10 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")smartbutton
10 years agoOccasional Contributor
Thank you for your input