Purpose The plug-in provide custom keywords to take screen shots with different options: normal mode, full page of the current web site, take screen shots and scale images according to device pixel ratio or cut off header & footer and take screen shots of web element(s). Based on taken screen shots and baseline images, we can compare images or get difference ratio between them
Usage examples 'Take screenshot of the page within screen size' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeScreenshot'('fullscreen.png', FailureHandling.OPTIONAL)
'Take screenshot of the page within screen size and cut header and footer' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeCuttingScreenshot'('cutting_screen.png',100, 50, FailureHandling.OPTIONAL)
'Take screenshot of the page within screen size and scale image according to dpr' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeScalingScreenshot'('scaling_screen.png',2 , FailureHandling.OPTIONAL)
'Take screenshot of the full page' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeEntirePageScreenshot'('fullpage_screen.png', FailureHandling.OPTIONAL)
'Take screenshot of the logo' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeWebElementScreenshot'(ObjectRepository.findTestObject('Object Repository/Cambridge/img_Logo'), filename, 10, FailureHandling.OPTIONAL) 'Baseline the image' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.baselineImage'(filename, baselineDir, FailureHandling.OPTIONAL)
'Compare logo is matched the baselined image' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ImageComparison.verifyMatchBaseline'(filename, baselineDir, FailureHandling.CONTINUEONFAILURE)
'Compare logo is matched the another image' CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ImageComparison.areMatched'(baselineDir + "\" + filename, screenshotDir + "\" + filename, FailureHandling.CONTINUEONFAILURE)
'Get difference ratio of two images' def ratio = CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ImageComparison.getDifferenceRatio'(baselineDir + "\" + filename, screenshotDir + "\" + filename, FailureHandling.CONTINUEONFAILURE) println ratio
Visit Katalon Forum for Plugin related discussions.