hi Marcin,
I am using a class test status tracker class that extends
AbstractGlobalExtension.
When an error occurs, I need to take a screenshot. Can you please tell how
I can access the browser driver here?
class TestResultExtension extends
AbstractGlobalExtension
{
@Override
void visitSpec(SpecInfo spec) {
spec.addListener(new ErrorListener())
}
static class ErrorListener extends AbstractRunListener {
ErrorInfo errorInfo
# Browser browser
@Override
void beforeIteration(IterationInfo iteration) {
errorInfo = null
}
void afterIteration(IterationInfo iteration){
if (errorInfo!=null){
driver.manage().window().maximize()
takeScreenshot(driver)
}
}
--
You received this message because you are subscribed to the Google Groups "Geb
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/geb-user/c3528479-3066-4c93-a656-5b234c7f67b4n%40googlegroups.com.