Skip to content

bitter/selenium-screenshot-recorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A small tool for recording selenium browser frames.

This is a small utility i primarily created to be able to easier debug errors in selenium tests and communication errors between selenium and the actual browser.

The utility dumps a screenshot for every executed selenium command. This may produce a LOT of files so tread carefully ;)


Usage: // First of all you should switch from DefaultSelenium to RecordingDefaultSelenium. // then you need to update your test to inject a ScreenshotRecorder thread local. // One way to do this is described by the following example:

class MyTestBase extends TestCase {

    public void runBare()
        throws Throwable
    {
        ScreenshotRecorder recorder = new ScreenshotRecorder(new File("/tmp"), getName());
        ScreenshotRecorder.set(recorder);
        try {
            super.runBare();
            
        } catch (Throwable t) {
           recorder.packageRecordedScreenshots();

        } finally {
            ScreenshotRecorder.set(null);
            recorder.deleteRecordedScreenshots();
        }
    }
}

About

This is a command processor that stores a screenshot after every command issued by selenium.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages