Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding screenshots at the required steps #993

Open
gogu1988 opened this issue Feb 28, 2021 · 1 comment
Open

Adding screenshots at the required steps #993

gogu1988 opened this issue Feb 28, 2021 · 1 comment

Comments

@gogu1988
Copy link

How to add screen shots at a gherkin step
How to write extra info to a given gherkin step

@SolannP
Copy link

SolannP commented Aug 10, 2021

Hi @gogu1988 , I'm not familiar with GittHub and issue management but open an issue may not be the best way to help you ..
This is our code using Katalon Studio but you can find plenty of help more suitable to your setup

@After
public void cucumberAfter(Scenario scenario) {
	if(scenario.isFailed()) {
			println "teardown Tests cucumber isFailed"
			try {
				String filePath = WebUI.takeScreenshot()
				File file = new File(filePath)
				scenario.embed(Files.readAllBytes(file.toPath()), "image/png")
				}
			catch (Exception e) {
				println "screenshot exception : "+e.message
			}
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants