Screenshots in ADO Execution

Hi,

I would like to capture screenshot on test failure when they are being executed in Azure Devops pipelines. Has anyone done that? If so, please outline how to do it.

Regards,
Karthik

1 Like

Hopefully this thread will help give you a little information: How take a full screenshot on Failure? - #2 by Russ_Thomas

@Russ_Thomas would you say taking a full page screen shot is something we should ask about as an enhancement? We could also add this to the product ideation area to have people vote on its importance.

Best, Sara

1 Like

I was actually referring to the specific aspect of taking screenshot for an ADO execution and how to view it. I dont mind if its full page or a focused one(the link you shared deals with that)

1 Like

I would, yes. I’ve asked for it in the past (here on the forum somewhere). The current implementation is limited to the viewport (as far as I recall) but it’s often a requirement to capture the entire browser window.

And that’s just WebUI. Not sure what’s available for Mobile, or, indeed, Windows desktop apps.

1 Like

The discussion has moved to a totally different topic than the one related to my question

1 Like

Hey @karthik.srivatsan ,

Thank you for letting us know your problem. I would like to clarify on your initial topic that you would like to configure screenshot test failure in Azure Devops pipelines, is that correct?

If so, I would like to suggest some of the following ways that I can research:

  1. There is not a way to display it directly in the pipeline but you can try this workaround.
  2. It is hard to scope down just to capture the test failure. You can try export all test results (not screenshot but an output file) by this way.

If this is not your case, can you clarify more on “capture screenshot” whether in ADO pipelines or Katalon test execution? The suggestions from @sara.leslie means to support screenshot test execution in Katalon Studio. Thank you and hope to help you!

3 Likes

I am afraid it is risky to take full page screenshots on failure in Test Cases.

My rational:

(1) a full page screenshot of a web page tends to be far larger in byte size than the viewport screenshot. For example, I tried the following test case:

import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.openBrowser("")
WebUI.navigateToUrl("https://forum.katalon.com/")
WebUI.takeScreenshot("viewport.png", FailureHandling.STOP_ON_FAILURE)
WebUI.takeFullPageScreenshot("fullpage.png");
WebUI.closeBrowser()

The viewport.png has 2400x1260 pixels, the fullpage.png has 2400x9998 pixels. The byte size of files are:

$ ls -la | grep .png
-rw-r--r--    1 kazuakiurayama  staff  1907100 11 12 09:04 fullpage.png
-rw-r--r--    1 kazuakiurayama  staff   270560 11 12 09:03 viewport.png

The fullpage.png is 7 times larger than the viewport.png. The proportion will depend on the design of each web pages; it might be 1.5:1, or 15:1.

(2) Users may create a Test Suite that contains tens or hundreds of Test Cases. Nobody can stop it.

(3) When a Test Suite contains many test cases that failed, the report becomes very large because the report contains the screenshot images taken on failure. It could easily exceeds 20 mega bytes in size.

(4) One of the recent topic TestOps report file size limit reported that Test Ops server seems to reject receiving a large report file uploaded from clients (Katalon Studio), possibly the limit is around 20mb.

(5) If Katalon Studio takes full page screenshots on failure, it is more likely that users encounter the problem of “Test Ops report file size limit”.

1 Like

I agree. But I said “entire browser window”, not “full page”.

1 Like

Its really simple - when executing a test in katalon in ADO i would like to capture screenshot on failure. And how would i view the same?

1 Like

Thank you all for answering , even though its not related to my question.

1 Like

Has this issue been solved? I am trying to see whats on the screen at a point manually but do not know where i can save this in pipelines?

1 Like

Has this been resolved or documented somewhere? I have the similar requirement and i would like to attach the images that are generated on a failure to Azure Test Plans.

1 Like