- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to record a video in Selenium webdriver?
We can record a video with Selenium. There is no default technique in Selenium to record videos. The videos can be captured in the below processes−
ATUTestRecorder.jar and ATUReporter_Selenium_testNG.jar files need to be downloaded and saved within the project folder.
Next, add the above two jars to the project Build path. Right-click on project−> Click on Properties−> Choose Java Build Path−> Click on the Libraries tab−> Click on Add External Jars−> Browser and select the ATUTestRecorder.jar and ATUReporter_Selenium_testNG.jar−> Click on Apply−> Click OK.
Have a folder to hold the videos within the project.
Example
@BeforeMethod public void bmethod(Method m){ // format of the date and time defined DateFormat d = new SimpleDateFormat("yy−mm−dd HH−mm−ss"); // get the current date Date dt = new Date(); try { // video capture file name recorder = new ATUTestRecorder(System.getProperty("userdir") + "\TestVideos\" , m.getName() + "_" + d.format(dt), false); } catch (Exception e){ Log.error("Error capturing videos"); } //begin recording try { recorder.start(); } catch (Exception e){ Log.error("Error in beginning videos"); } }
Example
@AfterMethod public void amethod(iTestResult result) { try { recorder.stop(); } catch (Exception e){ Log.error("Error in stopping videos"); } }
For a Maven project, the pom.xml should have the setting −
- Related Articles
- How to Download & Install Selenium WebDriver?
- How can I record a Video in my Android app?
- How to get Tooltip Text in Selenium Webdriver?
- How to do session handling in Selenium Webdriver?
- How to open a new tab using Selenium WebDriver?
- How to refresh a webpage using Python Selenium Webdriver?
- How to handle frames in Selenium Webdriver in Python?
- How to take screenshot with Selenium WebDriver?
- How to hide Firefox window (Selenium WebDriver)?
- How to send cookies with selenium webdriver?
- How to Verify Tooltip using Selenium WebDriver?
- How to upload files using Selenium Webdriver?
- How to open a link in new tab using Selenium WebDriver?
- How to verify color of a web element in Selenium Webdriver?
- How to Scroll Down or UP a Page in Selenium Webdriver?

Advertisements