1

Is it possible to log messages or DOM elements in the JavaScript console using the Selenium WebDriver? That would be very helpful for debugging my tests.

1 Answer 1

2

If you use FireBug, you can use it to show the log messages.

You can call the FireBug's log message javascript function through the web driver using execute_script or execute_async_script

Sign up to request clarification or add additional context in comments.

2 Comments

That's great, thanks. Should also work with the embedded Google Chrome JavaScript console, right?
Yes, if the executed JavaScript will print on the chrome console, calling the execute_script should have the same effect :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.