Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use a test setup with Webdriver and TestNG in Eclipse using java client. Earlier when i was using Selenium 1 in this same setup, it was giving a very descriptive line by line run-info which made it very easy to trouble shoot. Is there any way to get this activated in webdriver ?

share|improve this question
I have yet to figure this out. For now, I just debug by throwing a new SeleniumException(messageString) – MacGyver Jan 22 '12 at 2:44
up vote 1 down vote accepted

The easiest way is using WebDriverEventListener together with EventFiringWebDriver.

LogDriver listener = new LogDriver();
driver = new EventFiringWebDriver(new FirefoxDriver(profile)).register(listener);

where LogDriver should be your own class implementing WebDriverEventListener.

WebDriverEventListener methods are fired every time you use WebDriver action like findElement or click. Therefore you can put there a couple of System.out.printlns() (or something more sophisticated like appending to html file) and it should be enough for troubleshooting.

share|improve this answer
thanks i will try that out, for the time being, I am using a combination of both exception handlers with print stacktrace for debugging if anything fails – Rakesh Prabhakaran Jul 27 '12 at 4:29

If you run the webdriver in remotewebdriver mode, you should be able to see these commands in the node terminal. Hub will be sending these commands to node terminal. Its not the best way, but works.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.