Retrieve Browser Log using Selenium RC

Posted on Friday, August 26, 2011

I wasn't able to locate anything that natively allowed me to save the browser log being written to during the test.

I included the following javascript as a user extension, which hooks into Selenium's browser logging functionality:

You can then retrieve the log text as a string at the end of your test using GetEval

I go a step further and utilize TestContext.AddResultFile(String filename), included in Visual Studio 2010's testing suite, to neatly attach the browser log to the test result:

Labels: , ,


Post a Comment

Subscribe to Post Comments [Atom]

<< Home