Code Monkey home page Code Monkey logo

katalon-studio-ashot-plugin's Introduction

katalon-studio-ashot-plugin

Also try out the early release of Katalon TestOps Vision for Visual-based Testing!

The plugin provide custom keywords for working with taking screenshots with different options: normal mode, full page of the current web site, take screenshot and scale image according to device pixel ratio or cut off header & footer and take screenshot of web element(s). After that we save the screenshot into file .png files in the folder "Screenshots" of current working project folder. The images can be used as baseline images to detect GUI changes.

Usage

Take screenshot normal mode

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeScreenshot'('fullscreen.png', FailureHandling.OPTIONAL)

Take screenshot of a full website page

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeEntirePageScreenshot'('fullpage_screen.png', FailureHandling.OPTIONAL)

Take screenshot then cut off header and footer

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeCuttingScreenshot'('cutting_screen.png', FailureHandling.OPTIONAL)

Take screenshot then scale the image according to device pixel ratio

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeScalingScreenshot'('cutting_screen.png', 2,  FailureHandling.OPTIONAL)

Take screenshot of a web element(s)

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeWebElementScreenshot'(ObjectRepository.findTestObject('Object Repository/Cambridge/img_Logo'), filename, 10, FailureHandling.OPTIONAL)

prev = ObjectRepository.findTestObject('Object Repository/Cambridge/lnk_Nav_Prev')
next = ObjectRepository.findTestObject('Object Repository/Cambridge/lnk_Nav_Next')
'Take screenshot arrows'
CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeWebElementsScreenshot'([prev, next], 'arrows.png',
													  10, FailureHandling.OPTIONAL)                            

Take screenshot of a web elements ignoring inside areas

imgEnglish = ObjectRepository.findTestObject('Object Repository/Cambridge/img_English_Dic')
iCopyright = ObjectRepository.findTestObject('Object Repository/Cambridge/ita_English_Copyright')
'Take screenshot arrows'
CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeElementScreenshotIgnoreAreas'(imgEnglish, 'english_dic.png',
													[iCopyright], 10, FailureHandling.OPTIONAL)

The output is image of web element with ingored areas being marked in gray color

Screenshot of element with ignoring areas

Compare images

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ImageComparison.verifyMatchBaseline'(filename, baselineDir, FailureHandling.CONTINUE_ON_FAILURE)

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ImageComparison.areMatched'(expected, actual, FailureHandling.CONTINUE_ON_FAILURE)

If they are not matched, an image will be created with different parts being highlighted

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ImageComparison.getDifferenceRatio'(imageFile1, imageFile2, FailureHandling.CONTINUE_ON_FAILURE)

Companion products

Katalon TestOps

Katalon TestOps is a web-based application that provides dynamic perspectives and an insightful look at your automation testing data. You can leverage your automation testing data by transforming and visualizing your data; analyzing test results; seamlessly integrating with such tools as Katalon Studio and Jira; maximizing the testing capacity with remote execution.

Katalon Studio

Katalon Studio is a free and complete automation testing solution for Web, Mobile, and API testing with modern methodologies (Data-Driven Testing, TDD/BDD, Page Object Model, etc.) as well as advanced integration (JIRA, qTest, Slack, CI, Katalon TestOps, etc.). Learn more about Katalon Studio features.

katalon-studio-ashot-plugin's People

Contributors

devalex88 avatar dungleonhart avatar mytt221 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

katalon-studio-ashot-plugin's Issues

Screenshots not captured for "takeWebElementScreenshot" and "takeWebElementsScreenshot"

Am not able to capture screenshots for "takeWebElementScreenshot" and "takeWebElementsScreenshot" using below code.

CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeScalingScreenshot'('cutting_screen.png', 2,  FailureHandling.OPTIONAL)
CustomKeywords.'kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeWebElementScreenshot'(findTestObject('Page_antenna/img_logo'), "logo.png", 10, FailureHandling.OPTIONAL)

got below as warning message in Katalon Studio.

org.openqa.selenium.JavascriptException: TypeError: $ is not a function

even though the test case shown as passed, screenshot is not saved in "Screenshot" folder.

kms.turing.katalon.plugins.visualtesting.ScreenCapture.takeWebElementScreenshot is PASSED

I have created plugin for this project, using

{
    "keywords": ["kms.turing.katalon.plugins.visualtesting.ScreenCapture", "kms.turing.katalon.plugins.visualtesting.ImageComparision"]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.