I want to close the browser window after a certain subscript is complete, then reopen it when the next subscript is called. How do I do this? In other words, I want a fresh browser for each section of my testing suite.
Use Script.ClearContext() after you close the browser and then use Script.SetContext("App/AppVersion") to start a "fresh" browser.
NOTE: You will probably have to put some static delays between the statements to close the browser and the statements to start it back up again to prevent QA Wizard Pro from attempting to restart a browser that has not yet completely "stopped"
See working example below.
<font class="small">Code:</font><hr /><pre>
Window("WysiCorp Report a Bug").EditBox("editboxUsername").TypeText("Guest" )
Window("WysiCorp Report a Bug").EditBox("editboxPassword").TypeText("SoloBug ")
Window("WysiCorp Report a Bug").Button("buttonLogin").Click()
Hi all, here is the solution I came too. It is a little redundant, for the sake of ensuring that the scripts that are called are starting from a completely known state. Otherwise, without this, if an error occured with one script, and it quit the script without closing the browser window, the following script would not be able to correctly open a new browser window in order to start fresh. I put this code at the beginning of every runnable script.
'If a window is open from a previous script, close it and reopen a new window.
If( Window("Browser").Control("NavigationField").WaitF orExists( 10000 ) ) Then