I am using Katalon Studio + Winium implementation to automate one of our windows application.
Test Script is written with help from Winium driver in Katalon studio script mode.
Script runs perfectly but in Reports Screenshot is not captured.
Wanted to know how can we capture screenshot using winium + Katalon and make sure it appears in test suite report
I want to take a screenshot of a windows application at run time and compare it with a reference.
How can I achieve this with Katalon ? At the time of this post, Windows.TakeScreenshot() does not exist.
Are there any currently working alternatives that I can use ? I heard of Winium… ? If someone can give pointers I would appreciate it.
@paudet You can try this script to take screenshots of the opened application
import com.kms.katalon.core.windows.driver.WindowsDriverFactory import com.kms.katalon.core.windows.keyword.helper.WindowsActionHelper String screenshotLocation = 'Put the screenshot location here' WindowsActionHelper.create(WindowsDriverFactory.getWindowsSession()).takeScreenshot(screenshotLocation)
Open your AUT with Recorder/Spy tools.
In the Captured Objects view, select a captured object and click Add Screenshot on the bottom right corner. Katalon Studio takes a screenshot of the selected captured object in the currently displayed screen. The screenshot is added to the Targets folder.
Thank you, I did find this; Windows.getDriver().getScreenshotAs(OutputType.FILE) and it works fine thank you !
Now the next thing I need is a function that compares two screenshots and returns a result.
I did find one but WinAppDriver returns me ‘command not recorgnized’ when I use it; Windows.getDriver().matchImagesFeature(). It’s the only command I found that compares screenshots but either I’m not using it correctly or it just doesn’t work. Any help ? Thanks !
I guess that there are some different solution to do that. Here is another one that you can consider http://woshub.com/take-user-desktop-screenshot-with-powershell/
Advantages: Not depend on any Tools
Disadvantages: Cannot hook screenshot into report