desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDSELECTIONERROR, true);
desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDXPATHERROR, false);
desiredCapabilities.setJavascriptEnabled(true);
return new HtmlUnitDriver(desiredCapabilities);
} else if (FIREFOX.equalsIgnoreCase(browser)) {
return maximize(new FirefoxDriver());
} else if (OPERA.equalsIgnoreCase(browser)) {
return createInstanceOf("com.opera.core.systems.OperaDriver");
} else if (PHANTOMJS.equals(browser)) {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setJavascriptEnabled(true);