How to capture a series of screenshots in Web Driver using Java



  • I Just wanted to know that how can we take a series of screenshots / a video recording for a screen using Selenium 2/Web Driver with JAVA ?

    Please provide the answer or the link where I can get an idea about it ?



  • Both Saucelabs and TestingBot provide a service which records your Selenium tests if you run them against their Selenium Grid. Both offer a number of free minutes per month, which might suffice your needs. You can view/download the video's straight after the test run is finished.

    Although I don't know how their setup works, I think I can give you some idea's how to create something similar in your local environment.

    1. Start your test run from a build server (Jenkins for example)
    2. Let the build server start a Selenium server on the test node
    3. Let the build server start a screen recorder on the test node (With VLC for example)
    4. Start and run your (Java based) Selenium test against the test node
    5. Stop the recording on the test node
    6. Copy the recording to the build server so you can access it later on

    For this you will need some infrastructure (servers) and some scripts to tie everything together, but its certainly not undoable.

    Another option is to take a screenshot after each step/action and combine those screenshots into a video.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2