StopBrowserAction extends AbstractSeleniumAction { @Override protected void execute(SeleniumBrowser browser, TestContext context) { log.info("Stopping browser of type {}", browser.getEndpointConfiguration().getBrowserType()); browser.stop(); context.getVariables().remove(SeleniumHeaders.SELENIUM_BROWSER); } StopBrowserAction(Builder builder);   }
@Test public void testStop() throws Exception { context.setVariable(SeleniumHeaders.SELENIUM_BROWSER, "ChromeBrowser"); StopBrowserAction action = new StopBrowserAction.Builder() .browser(seleniumBrowser) .build(); action.execute(context); Assert.assertFalse(context.getVariables().containsKey(SeleniumHeaders.SELENIUM_BROWSER)); Assert.assertNull(seleniumBrowser.getWebDriver()); verify(webDriver).quit(); }