How to take screenshots in Selenium WebDriver?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Jun 14, 2021

 

You can take screenshots in Selenium WebDriver with the help of the following steps:

  • Create a class. Implement TestNG 'ITestListener'.
  • Call the method 'onTestFailure'.
  • Add the code to take a screenshot with this method.
  • Get the Test method name and take a screenshot with the test name.
  • Now, place it in the desired destination folder.

 

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Selenium Interview questions

    What Evaluation can Selenium Do?

    Selenium Could be Utilized for the purposeful, Regression, load testing of the Internet-based program. The Automation To..

    Selenium Interview questions

    Just how much does Selenium License cost per Customer Device?

    Selenium is open-source software, released under the Apache 2.0 license and can be downloaded and used without charge...

    Selenium Interview questions

    Where to obtain Selenium ?

    Selenium Can be Downloaded and Installed for free-form Seleniumhq.org..