Test specific browser behavior configuration - Xceptance/neodymium GitHub Wiki
Test specific browser behavior configuration
The general behavior of the browser during test, can be configured in the Neodymium configuration properties. Sometimes it is necessary to override the general browser behavior with an adjusted behavior. Neodymium provides a number of annotations to specify the browser behavior for each test and/or testclass. The following annotations can be used.
KeepBrowserOpen
This annotation defines if the browser should be kept open after the test execution.
This annotation has a boolean parameter. That will define if this should only be done in the case of the test failing. With true meaning that the browser will be kept open in case of test failure and false meaning that the browser will be kept open in any case.
@Test
@KeepBrowserOpen(false)
public void alwaysKeepBrowserOpen() {
...
}
In this example the browser would be kept open regardless of the testresult.
@Test
@KeepBrowserOpen(true)
public void keepBrowserOpenOnFailure() {
...
}
And in this example the browser would only be kept open if the test fails.