In the previous post AShot() in Selenium 3 for taking full page screenshot? we have seen how to capture the full page screenshot in Selenium using AShot() utility. Now we will see how to capture the screenshot of WebElement using AShot().
Syntax: The below method is used to capture the screenshot of the web element.
Step 1: Download AShot() and Selenium Standalone. Add this two jar files to the project.
Step 2: The below sample test launches Selenium Babu blog and captures the screenshots of Total Pageviews and Title Logo.
Step 3: Checkout the below video for better understanding.
Syntax: The below method is used to capture the screenshot of the web element.
- We need to pass two arguments to the above method, one is WebDriver object and another is web element .
Step 1: Download AShot() and Selenium Standalone. Add this two jar files to the project.
Step 2: The below sample test launches Selenium Babu blog and captures the screenshots of Total Pageviews and Title Logo.
Step 3: Checkout the below video for better understanding.
No comments:
Post a Comment