How To Record Selenium WebDriver Test Execution Video

If you lot can tape total video for your selenium examination execution automatically together with therefore It tin last dandy characteristic for you. I intend many of you lot are already aware well-nigh HOW TO CAPTURE SCREENSHOT of spider web page during examination execution In selenium. Very solely few people volition last aware
about video recording of shroud for selenium script. Webdriver produce non receive got whatever built In facility to tape video but nosotros bespeak to role some external services to tape video.

Why video recording of selenium test?
Supposing you lot receive got a selenium script which takes 1 or to a greater extent than hours to consummate the execution. So If you lot tin tape total examination execution shroud video together with therefore It volition helps you lot to debug Issue to a greater extent than easily If whatever Issue arise In between. Also you lot tin role recorded videos every bit a proof to exhibit examination execution activities to your customer or manager.

Steps to tape video for webdriver examination execution

We volition use ATU Test Recorder to tape selenium examination execution videos.

Step 1 : Download ATUTestRecorder jounce file

  1. Download Location : You tin download It from THIS PAGE. Click on ATUTestRecorder_2.1.zip link.
  2. Alternate Download Location : You tin download It from THIS LOCATION too.
Both to a higher house links volition furnish you lot "ATUTestRecorder_2.1.zip" file to download. Download It together with extract It. Thrre volition last "ATUTestRecorder_2.1.jar" file In extracted folder.

Step 2 : Add "ATUTestRecorder_2.1.jar" In your project's create path

Add "ATUTestRecorder_2.1.jar" file In your project's create path. You tin refer "Adding jounce Files In Project's Build Path" department on THIS PAGE If you lot don't know how to add together It.

Step 3 : Create folder to shop recorded videos.
You bespeak to create folder "ScriptVideos" In your D: drive. We volition role this folder to shop recorded videos.

Now nosotros are ready to tape videos for examination execution.

Steps 4 : Create together with run test

Create together with run bellow given examination In eclipse. As you lot come across In bellow given script, video recording volition last started In start because code to start video recording Is Inside @BeforeTest method. Video recording volition halt at halt of examination because code to halt recording Is Inside @AfterTest tone method.

package Testing_Pack;  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.firefox.FirefoxDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import atu.testrecorder.ATUTestRecorder;  populace shape RecordTest {    WebDriver driver;  ATUTestRecorder recorder;   @BeforeTest  populace void setup() throws Exception {   DateFormat dateFormat = novel SimpleDateFormat("yy-MM-dd HH-mm-ss");   Date appointment = novel Date();   //Created object of ATUTestRecorder   //Provide path to shop videos together with file cite format.   recorder = novel ATUTestRecorder("D:\\ScriptVideos\\","TestVideo-"+dateFormat.format(date),false);   //To start video recording.   recorder.start();     driver = novel FirefoxDriver();   driver.manage().window().maximize();   driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);   driver.get("http://google.com/");  }   @Test  populace void getScrollStatus() throws Exception {     driver.manage().window().setSize(new Dimension(400,768));   Thread.sleep(2000);        driver.manage().window().setSize(new Dimension(400,400));   Thread.sleep(2000);      driver.manage().window().setSize(new Dimension(1024,400));        }     @AfterTest  populace void Close() throws Exception {   driver.quit();   //To halt video recording.   recorder.stop();;  } }

At the halt of examination execution, Go to "D:\ScriptVideos" folder. There volition last created .mov file. You tin play It to come across recorded video.
More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM

http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post