With WebDriver + Internet Explorer, the following start up messages get appeared into Console :
Started InternetExplorerDriver server (32-bit)
2.43.0.0
Listening on port 47206
Oct 13, 2014 3:12:21 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
Oct 13, 2014 3:12:21 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Many of us always feel awkward about this and think to be some potential error with IEDriverServer. Here is some of pointers provided by Jim Evans on why we are wrong :
Want to block these messages anyway. Here is some code snippet which will do the trick.
Disable log messages
java.util.logging.Logger.getLogger("org.apache.http.impl.client").setLevel(java.util.logging.Level.WARNING);
java.util.logging.Logger.getLogger("org.apache.http.impl.client").setLevel(java.util.logging.Level.WARNING);
This is to disable log message from getting displayed on the console. Updated code will look like the following :
// Disable log messages
java.util.logging.Logger.getLogger("org.apache.http.impl.client").setLevel(java.util.logging.Level.WARNING);
System.setProperty("webdriver.ie.driver","D:\\Selenium Info\\IEDriverServer.exe");
DesiredCapabilities dc = DesiredCapabilities.internetExplorer();
dc.setCapability("silent", true);
WebDriver driver = new InternetExplorerDriver(dc);
Note: dc.setCapability("silent", true); only blocks IEDriver starting message.
Please find the full list of capabilities here : https://code.google.com/p/selenium/wiki/InternetExplorerDriver#Important_System_Properties
Hope this helps!
No comments:
Post a Comment