Forum Discussion

vikram_u_k's avatar
vikram_u_k
Contributor
8 years ago
Solved

Get Screenshot from Android using Cucumber

Hi Team/Support,    We are checking for certain attributes(color/font and size) of text that are not listed as object attributes nor methods exist to get their attributes for comparision.   With C...
  • vikram_u_k's avatar
    vikram_u_k
    8 years ago

    Hi,

      we resolved using the  @After    tag.

     

    @After
    	public void tearDown(Scenario scenario) throws IOException {
    		if (takeScreenshot() == true) {
    			final byte[] screenshot = getImageAsByteArray();
    			scenario.embed(screenshot, "image/png");
    		} else {
    			System.out.println("Error in capturing the screenshot");
    		}
    	}