if(blnFail)
embedScreenshotToCucumberReport();
public void embedScreenshotToCucumberReport()
{
final byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
scenario.embed(screenshot, "image/png");
}
Hi,Can someone help in the above query?Say i have a scenario, where i need to validate 10 objects exists in the first page.If any of the field say(2nd Object) does not exists in the application, then in cucumber reports the step should be marked as Failed and eventually entire scenario should be reported as failed but the script execution continue to validate the remaining objects(from 3rd object to 10th object). The script should not abort at 2nd object not found.Can someone help how to achieve this?Please let me know if anything above is not clear.Thanks,Uday
On Sunday, 11 September 2016 12:43:07 UTC+5:30, Udaya Kumar Anem wrote:Hi all,I have a scenario where i need to validate object existence in a form.If some object is missing, then in Cucumber reports, it should report the step as failed and attach the screenshot and then go for the next object validation(Here the execution should not aboard because this object does not exist.)
if(blnFail)
embedScreenshotToCucumberReport();
public void embedScreenshotToCucumberReport()
{
final byte[] screenshot = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);
scenario.embed(screenshot, "image/png");
}Here in this case the screenshot is attached to the step in Cucumber report, but the step is not marked as failed. I want to mark the step as failed which may cascade to the Scenario. How can i do that?Thanks,Uday
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Then the Mailing Information of Registration Form is displayed with
| Address |
| City |
| State/Province |
| Postal Code |
| Country |
@Then("^the Mailing Information of Registration Form is displayed with$")
public void verifyFieldsMailingSection(List<String> strFieldsInSection) throws Throwable
{
for(String strField:strFieldsInSection)
{
switch(strField)
{
case "Address":
if(objRegister.verifyAddress1())
reportStatus(StepStatus.PASS, "'Address1' field exists in 'Mailing Information' as expected");
else
reportStatus(StepStatus.FAIL, "'Address1' field does not exists in 'Contact Information'");
if(objRegister.verifyAddress2())
reportStatus(StepStatus.PASS, "'Address2' field exists in 'Mailing Information' as expected");
else
reportStatus(StepStatus.FAIL, "'Address2' field does not exists in 'Contact Information'");
case "City":
if(objRegister.verifyCity())
reportStatus(StepStatus.PASS, "'City' field exists in 'Mailing Information' as expected");
else
reportStatus(StepStatus.FAIL, "'City' field does not exists in 'Contact Information'");
break;
case "State/Province":
if(objRegister.verifyState())
reportStatus(StepStatus.PASS, "'State / Province' field exists in 'Mailing Information' as expected");
else
reportStatus(StepStatus.FAIL, "'State / Provinc' field does not exists in 'Contact Information'");
break;
case "Postal Code":
if(objRegister.verifyPostalcode())
reportStatus(StepStatus.PASS, "'Postal Code' field exists in 'Mailing Information' as expected");
else
reportStatus(StepStatus.FAIL, "'Postal Code' field does not exists in 'Contact Information'");
break;
case "Country":
if(objRegister.verifyCountry())
reportStatus(StepStatus.PASS, "'Country' field exists in 'Mailing Information' as expected");
else
reportStatus(StepStatus.FAIL, "'Country' field does not exists in 'Contact Information'");
break;
}
}
}
case "FAIL":
reportExecutionLog("fail", strStepDescription);
String strFailureStepFilePath = returnScreenshotFilePath();
logStep.log(LogStatus.FAIL, String.valueOf(strStepDescription) + logStep.addScreenCapture(strFailureStepFilePath));
embedScreenshotToCucumberReport();
break;
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.