filmov
tv
Selenium WebDriver Session 18 - How to Capture Screenshot of a page

Показать описание
How to Capture Screenshot of a page with the help of TakesScreenshot interface, getScreenshotAs() & copy() method and File & FileHandler class - Selenium WebDriver Session 18 by Haradhan Pal
Capturing Screenshot in Selenium WebDriver is a 3 Step process:
1. Since TakesScreenshot is an interface, user cannot create an object directly. User need to convert the web driver object to TakesScreenshot.
TakesScreenshot screenshot =((TakesScreenshot)driver);
2. User need to call getScreenshotAs() method to create an image file which is provided by the TakesScreenshot interface to capture the screenshot of the web page displayed in the driver object.
Here, the argument “OutputType.FILE” specified in the getScreenshotAs() method will return the capture screenshot in the form of file. Therefore, user can store in the variable ‘srcFile’ with type File.
3. Save the file object returned by getScreenshotAs() method using copy() method of the FileHandler class.
Kindly do subscribe my channel and watch videos, like, comments and share it with team.
Do not forget to press the Bell icon so that you will get notification as and when I will upload any new videos.
Keyword:
Selenium,
Automation,
testing,
java,
Java,
webdriver,
selenium interview questions,
selenium framework,
selenium tutorial,
selenium testing tutorial,
selenium java tutorial,
java tutorial,
Haradhan Pal,
haradhan pal,
Haradhan Automation Library,
haradhan automation library,
haradhan,
java basics,
java basics concepts,
java advanced,
automation testing,
automation testing selenium,
automation framework,
java advanced topics,
framework in java,
selenium java example,
selenium java interview questions,
selenium practical interview questions,
selenium java programs interview questions,
selenium,
automation,
most popular java frameworks,
test automation framework design,
test automation framework design,
automation framework design,
automation framework selenium,
selenium framework design from scratch,
selenium framework types,
data driven framework in selenium,
automation testing,
Eclipse,
eclipse,
chrome driver,
Chrome Driver,
IE Driver,
GeckoDriver,
gecko driver,
ie driver,
object,
class,
Object,
Class,
Testing,
WebDriver,
selenium webdriver,
selenium testing,
haradhan automation,
automation library,
take screenshot,
capturescreenshot,
screenshot,
takes screenshot,
TakesScreenshot,
getScreenshotAs,
copy,
file,
FileHandler,
filehandler
Capturing Screenshot in Selenium WebDriver is a 3 Step process:
1. Since TakesScreenshot is an interface, user cannot create an object directly. User need to convert the web driver object to TakesScreenshot.
TakesScreenshot screenshot =((TakesScreenshot)driver);
2. User need to call getScreenshotAs() method to create an image file which is provided by the TakesScreenshot interface to capture the screenshot of the web page displayed in the driver object.
Here, the argument “OutputType.FILE” specified in the getScreenshotAs() method will return the capture screenshot in the form of file. Therefore, user can store in the variable ‘srcFile’ with type File.
3. Save the file object returned by getScreenshotAs() method using copy() method of the FileHandler class.
Kindly do subscribe my channel and watch videos, like, comments and share it with team.
Do not forget to press the Bell icon so that you will get notification as and when I will upload any new videos.
Keyword:
Selenium,
Automation,
testing,
java,
Java,
webdriver,
selenium interview questions,
selenium framework,
selenium tutorial,
selenium testing tutorial,
selenium java tutorial,
java tutorial,
Haradhan Pal,
haradhan pal,
Haradhan Automation Library,
haradhan automation library,
haradhan,
java basics,
java basics concepts,
java advanced,
automation testing,
automation testing selenium,
automation framework,
java advanced topics,
framework in java,
selenium java example,
selenium java interview questions,
selenium practical interview questions,
selenium java programs interview questions,
selenium,
automation,
most popular java frameworks,
test automation framework design,
test automation framework design,
automation framework design,
automation framework selenium,
selenium framework design from scratch,
selenium framework types,
data driven framework in selenium,
automation testing,
Eclipse,
eclipse,
chrome driver,
Chrome Driver,
IE Driver,
GeckoDriver,
gecko driver,
ie driver,
object,
class,
Object,
Class,
Testing,
WebDriver,
selenium webdriver,
selenium testing,
haradhan automation,
automation library,
take screenshot,
capturescreenshot,
screenshot,
takes screenshot,
TakesScreenshot,
getScreenshotAs,
copy,
file,
FileHandler,
filehandler