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
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
2 Comments
Randomblue
That's great, thanks. Should also work with the embedded Google Chrome JavaScript console, right?
Jude Cooray
Yes, if the executed JavaScript will print on the chrome console, calling the
execute_script should have the same effect :)