How to take screenshot of failed test cases in Selenium

Опубликовано: 27 Август 2021
на канале: automateNow
1,389
27

Learn how to take a screenshot of failed test cases in Selenium.

TestNG offers an interface called ITestListener, we can use a method called onTestFailure() within this interface in order to take a screenshot of failed tests. This video will show you how to implement this method.

You can find the source code for this project on automateNow's GitHub page.
https://github.com/automatenow/Interm...

😀 Subscribe for weekly videos! 👍

📑 CHAPTERS

0:00 ~ Why taking screenshots of failed tests is useful
0:14 ~ Add a utilities package and class
0:56 ~ Implement ITestListener methods
1:58 ~ Create directory to store screenshots
2:19 ~ Implement onTestFailure() method
3:03 ~ Run a test that takes a screenshot
5:43 ~ Add the failed test to the screeshot file name
7:19 ~ Explaining onTestStart() method

👩‍🎓 COURSES

☕ Java For Absolute Beginners https://bit.ly/learn-java2022

⏯ PLAYLISTS

☑️ Automation Fundamentals https://bit.ly/2QbN7qm
☑️ Automation Tools https://bit.ly/2OFj4qO
☑️ General WebDriver https://bit.ly/2Z3tG7y
☑️ Intro to WebDriver https://bit.ly/3gb5Jlx
☑️ Intermediate WebDriver https://bit.ly/2OBTR0r
☑️ Java https://bit.ly/3sBuI7M
☑️ Selenium 4 https://bit.ly/2VQ1lA9
☑️ Version Control https://bit.ly/3CvHplU
☑️ Web Element Locators https://bit.ly/2QfDGpK

📫 LET'S CONNECT!

☑️ https://linktr.ee/automateNow


Смотрите видео How to take screenshot of failed test cases in Selenium онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь automateNow 27 Август 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,389 раз и оно понравилось 27 людям.