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 Cucumber we have implemented steps to call routines in the testComplete Scripts as per CucumberStubs example.
Our current task is to get the screenshots generated in the stubs back onto the Cucumber Report(the THEN condition in particular as it has multiple attributes to be validated).
In particular the screenshot is stored in the log folder with unique names. Could we expect to get this image name exported?.
Is there a article which helps provide some direction in getting the screenshot so that we may automate the GIVEN, WHEN steps but have the screenshot from the THEN condition verified manually.
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"); } }