Wednesday, 16 July 2014

Record(video) selenium test execution report

we need to record test execution and review the video after the execution has finished.
This is especially important if you run unattended tests on a different machine and find out about failed tests after the event.
Step 1: download jar from "https://drive.google.com/folderview?id=0B7rZvkq9tkwPRy1HLVJCdWtNekE&usp=sharing"
What additional work you have to do for this?
Ans: You just have to add 3 lines of code for
Setting up a recorder
Starting the recorder
Stopping the recorder


Sample script:
package Record;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import atu.testrecorder.ATUTestRecorder;
import atu.testrecorder.exceptions.ATUTestRecorderException;

public class Class1 {
static WebDriver driver;
public static void main(String[] args) throws ATUTestRecorderException {
//Here need to give file location and file name
ATUTestRecorder recorder = new ATUTestRecorder("D:\\sws","practice",false);
recorder.start();

//public static void main(String[] args) {


driver = new FirefoxDriver();
driver.navigate().to("http://www.w3schools.com/ajax/ajax_database.asp");
driver.manage().window().maximize();
driver.quit();
recorder.stop();

}
}
Run the test case 
see video from location where u stored.

2 comments:

  1. i did complete my record, and it creates one video clip , but when i click on that video clip it ssays like Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file.

    SO, what i do, let me inform fast pleasee

    ReplyDelete
  2. Install vlc player and try, still if u face problem let me know

    ReplyDelete