Forum Discussion
sriguda
11 years agoFrequent Contributor
Can I put this statement in Keyword test r it has to be in script routine.
Lage
11 years agoContributor
You must put the statement that amarr1143l wrote before in a script. But you can call this script from a keywordTest using the Operation "Run Script Routine".
Personally I like to have the current browser setted in a Project varible.
- Project.Variables.Browser = "chrome"
Also I have a variable to set if I want to close or not the browsear at the begining of each test:
- Project.Variable.CloseBrowser = true
(What I do is not exactly this way but similar). Just call a "Run Script Routine" at the begining of each KeywordTest to initialice the execution. That may close the browser or not depending on the stored CloseBrowser project variable.
Sub CloseSpecifiedBrowser
If Project.Variables.CloseBrowser Then 'this is a Boolean value
'Close all open specified Browser Windows
While Sys.WaitProcess(Project.Variables.Browser,2000).Exists
Sys.Process(Project.Variables.Browser).Terminate
WEND
End If
End SubHope it helps