I'm currently running tests with Selenium and Java. I've experienced success in printing the pages' HTML from JavaScript by using an alert:
js.executeScript("alert($('html').html());");
However, when trying to use return, nothing gets displayed in the Eclipse console:
js.executeScript("return $('html').html();");
What mistake am I making, and how can I print (using System.out.print) the HTML output from the return statement in JavaScript? Thanks in advance! And just to clarify, I prefer not to utilize source.