Selenium 远程执行和监听类

public class BrowserChromeImpl implements BrowserDriver {
    @Override
    public WebDriver getDriver() {
        SeleniumListener seleniumListener = new SeleniumListener();
        return new EventFiringWebDriver(new ChromeDriver()).register(seleniumListener);
    }

    @Override
    public WebDriver getDriver(URL url) {
        SeleniumListener seleniumListener = new SeleniumListener();
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        return new EventFiringWebDriver(new RemoteWebDriver(url,capabilities)).register(seleniumListener);
    }
}

 

posted @ 2015-03-19 00:25  脱氧  阅读(515)  评论(0编辑  收藏  举报