Forum

Forum Navigation
You need to log in to create posts and topics.

Evidence screenshots

Hi guys,

Taking screenshots of the application window when we have failures is the default behavior in Boozang. There is also a use-case when you want to take screenshots of the application window or specific parts, for instance in collecting evidences. We have two utility-functions for this, that you can use in this case: $util.attachScreenshotToReport and $util.takeScreenshot

The most common usage of taking screenshots when a test isn't failing to take a screenshot and attach it to the Cucumber report (evidence)

attachScreenshotToReport(elementPath)

If you leave element path empty, the default is to take a screenshot of the whole browser window

attachScreenshotToReport()

Below is an example on how you can use it. Note that the JS code is run in the IDE window.

You can also take a screenshot and do other operations. To support this, we allow you to plug in a callback function, like the example below. 

$util.takeScreenshot(elementPath, callBackFunction)

The call-back function will contain the screenshot as an argument, for example

 $util.takeScreenshot(elementPath, function(v){

  console.log(v);

})

The evidence screenshots should be supported for most Cucumber reporting plugins.

Let us know what you think and if you see any issues.

Try Boozang today

Codeless testing that works. No credit card or commitment required.