jeudi 27 avril 2017

Prevent HtmlUnitDriver headless Selenium test invoke a browser window

We are trying to use HtmlUnitDriver for our GUI-less test automation. Actually we want to test for Chrome browser for compatibility purpose wise. Meaning most of our users are Chrome users. Our invocation is like this ...

driver = new HtmlUnitDriver(BrowserVersion.CHROME); driver.get(baseURL);        driver.sleep(2000);

But when ran, it briefly invoking a Chrome browser window, which closes by itself and the test proceeds OK. HOw can we prevent the Browser intance to open ? This exercise is to avoid the "Chrome not reachable" problem with normal Selenium WebDriver code.

Aucun commentaire:

Enregistrer un commentaire