Hello Team,
i would like to capture screenshot on failure. Below is my script could you please suggest how to capture screenshot on failure.
I am using spock framework. I used report its capturing screenshot at the end of execution always i see login page...(after logout its navigating to login page). Is there any way i can capture screenshot when my script is failed
class VerifyFilterResultsSpec extends GebReportingSpec{
LoginService loginService = new LoginService()
LogoutService logoutService = new LogoutService()
def "Login as Merchant and verify the filter functionality in text box"() {
given:"Merchant user logs into application"
to LoginPage
loginService.login(EnvDetails.merchantUserName)
when:"Navigate to application"
to DashboardPage
then: "Verify View dropdown is available and check if the graphs are displayed"
at DashboardPage
assert complianceModule.ddViewSupplierPartnerGroupSelectedText.text()=='Suppliers'
cleanup: "Logout of application"
logoutService.logout()
}
}
--