Take ScreenShot in Appium

Price: INR 1,299.00
Was: INR 1,799.00

Let’s see, How can you take the ScreenShot in Appium. In previous tutorials, You have seen, How can perform Scroll Tabs in Android. Now we will see, How can we take Screenshots in Andriod Application.

 

In Automation Testing process, capture screenshot is important to show the bug or some design Issue to development/design team.

Like Selenium WebDriver, In Appium we also can capture the application Screenshot for this we can use TakesScreenshot Interface of WebDriver.

 

Take ScreenShot in Appium

In below-given example, we will see, How to capture screenshot in Andriod using Appium. In the below example, We click on the “Country” Element and scroll to text India and capture the screen shot.

In the above Test Script, We click on the Country Element and Scroll down till we got the textIndia. Then It will call takeScreenShot(); method to capture and store android app screenshot. takeScreenShot() method will –

 

  • Capture screenshot using TakesScreenshot Interface of webdriver.

  • Get current date and time and store It in variable.

  • Create the new folder with name “screenshots” under your project.

  • Set file name using current date and time.

  • Store file In “screenshots” folder.

 

Using this way, You can capture the screen shot of your Test screens and save it for further reference.

2 Comments
  1. Albert 7:03 PM / October 5, 2017 - Reply

    Is there a way to take a full page screenshots on Android Device Using Appium with Chrome.

Leave a Reply