Recording of test execution using ATUTestRecorder

This blog will show how to record test execution using ATUTestRecorder in selenium web driver.

Selenium web driver didn’t provide an inbuilt feature for recording test execution but by using the ATUTestRecorder it can be done. This recorded video helps to identify the issue more easily and can use this video as proof to show activities to stakeholders.

Let’s start integrating ATUTestRecorder in selenium webdriver by following steps:

  • Download ATUTestRecorder.jar and ATUReporter_Selenium_testNG.jar files.
  • Add these downloaded jar files into the build path.
download-zar-file
  • Create a new folder in the project to store the recorded videos.
Create-new-folder
  • Add a new package(e.g. package_ATUTestRecorder) in the project and create a new class (e.g. Demo.java) into that.
save-new-package
  • Open class (\src\package_ATUTestRecorder\Demo.java) and write below code into that.


package package_ATUTestRecorder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import atu.testrecorder.ATUTestRecorder;

public class Demo {

WebDriver driver;
ATUTestRecorder recorder;

@BeforeTest
public void ATURecordersetup() throws Exception {
DateFormat dateFormat = new SimpleDateFormat(“yy-MM-dd HH-mm-ss”);
Date date = new Date();
recorder = new ATUTestRecorder(“Location of video folder”,”RecordedVideo-“+dateFormat.format(date),false);
recorder.start();
String Chromepath = “E:\\chromedriver.exe”;
System.setProperty(“webdriver.chrome.driver”, Chromepath);
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.get(“https://www.ignatiuz.com/”);
}
@Test
public void ScreenResolutions() throws Exception {
driver.manage().window().setSize(new Dimension(500,700));
Thread. sleep(1000);
driver.manage().window().setSize(new Dimension(700,500));
Thread. sleep(1000);
}
@AfterTest
public void Close() throws Exception {
driver.quit();
recorder.stop();;
}
}

  • Now, run the script and once it’s successfully executed it will create .mov extension video into a specified location.
.mov-extenstionvideo
  • Click to play recorded video into the player.
recorded-video

Related Posts

Leave a comment