PDF Report Generation In Parallel Execution Using Cucumber
PDF report generation for parallel test execution in cucumber
Жүктеу.....
Пікірлер: 16
@aparajitakumari7778 Жыл бұрын
Very helpful video. Thank you for creating such videos and helping others.
@jayaranjitha8275Ай бұрын
do we need to call that pdf class anywhere?
@NirajGupta
Ай бұрын
Yes.Sorry I missed in video. In pom.xml you need to call. Just add this plugin under build-- org.codehaus.mojo exec-maven-plugin 1.6.0 first-execution install java test com.automation.util.PDFReport_Parallel_Execution
@archanamuthukrishnan6465 Жыл бұрын
Hello Sir I am using Cucumber framework. I am able to run parallel testing successfully but when I add rerun file in my pom.xml runner rerun and when I try to run in parallel..it is running sequentially not in parallels
@NirajGupta
Жыл бұрын
It should be run in parallel.check youe pom.xml
@archanamuthukrishnan6465
Жыл бұрын
@@NirajGupta 3
@NirajGupta
Жыл бұрын
I will check in weekend
@bhuvaneshwarisomu47092 жыл бұрын
Can you please help with the screenshot? am not getting the screenshot during conversion ( both base64 and png )
@NirajGupta
2 жыл бұрын
one way of getting screenshot is File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); Files.copy(scrFile, new File(screenShotFolder + "//ScreenShot" + strDate)); otherway of taking screenshot--final byte[] screenshot = ((TakesScreenshot) SeleniumUtil.getDriver()).getScreenshotAs(OutputType.BYTES); scenario.embed(screenshot, "image/png");
@pradeep_78624 жыл бұрын
Can i get the pom.xml as well please? or a GIT HUB link for this project?
Пікірлер: 16
Very helpful video. Thank you for creating such videos and helping others.
do we need to call that pdf class anywhere?
@NirajGupta
Ай бұрын
Yes.Sorry I missed in video. In pom.xml you need to call. Just add this plugin under build-- org.codehaus.mojo exec-maven-plugin 1.6.0 first-execution install java test com.automation.util.PDFReport_Parallel_Execution
Hello Sir I am using Cucumber framework. I am able to run parallel testing successfully but when I add rerun file in my pom.xml runner rerun and when I try to run in parallel..it is running sequentially not in parallels
@NirajGupta
Жыл бұрын
It should be run in parallel.check youe pom.xml
@archanamuthukrishnan6465
Жыл бұрын
@@NirajGupta 3
@NirajGupta
Жыл бұрын
I will check in weekend
Can you please help with the screenshot? am not getting the screenshot during conversion ( both base64 and png )
@NirajGupta
2 жыл бұрын
one way of getting screenshot is File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); Files.copy(scrFile, new File(screenShotFolder + "//ScreenShot" + strDate)); otherway of taking screenshot--final byte[] screenshot = ((TakesScreenshot) SeleniumUtil.getDriver()).getScreenshotAs(OutputType.BYTES); scenario.embed(screenshot, "image/png");
Can i get the pom.xml as well please? or a GIT HUB link for this project?
@NirajGupta
4 жыл бұрын
4.0.0 com.SeleniumCumber SeleniumCumber 0.0.1-SNAPSHOT jar SeleniumCumber maven.apache.org UTF-8 1.2.5 org.apache.maven.plugins maven-compiler-plugin 3.1 1.8 1.8 org.codehaus.mojo exec-maven-plugin 1.6.0 first-execution install java test com.automation.util.PDFReport_Parallel_Execution org.apache.maven.plugins maven-surefire-plugin 2.19 7 true **/TestRunner.class net.masterthought maven-cucumber-reporting 3.6.0 execution verify generate cucumber-jvm-example ${project.build.directory}/cucumber-JVM-reports ${project.build.directory}/cucumber.json true true 42 junit junit 4.12 test org.seleniumhq.selenium selenium-java 3.8.1 info.cukes cucumber-junit ${cucumberversion} info.cukes cucumber-java ${cucumberversion} log4j log4j 1.2.17 org.apache.poi poi 3.17 org.apache.poi poi-ooxml 3.17 net.masterthought cucumber-reporting 3.20.0 com.github.mkolisnyk cucumber-runner 1.3.3 io.woo htmltopdf 1.0.5
@NirajGupta
4 жыл бұрын
github.com/callnirajgupta/CucumberSelenium/blob/master/pom_parallel.xml
Very useful video. Great work. Can I have code
@NirajGupta
5 жыл бұрын
public static void consolidateAllJsonAndGenerateHTMLReport(){ //this will generate consolidated html reports File reportOutputDirectory = new File("target/ConsolidatedHtmlReport"); List jsonFiles = new ArrayList(); File file = new File(System.getProperty("user.dir")+"\\target"); String[] fileList = file.list(); /* for(String name:fileList){ if(name.endsWith(".json")){ jsonFiles.add(System.getProperty("user.dir")+"\\target\\"+name); } }*/ jsonFiles.add(System.getProperty("user.dir")+"\\target1\\cucumber.json"); jsonFiles.add(System.getProperty("user.dir")+"\\target2\\cucumber.json"); String buildNumber = "1"; String projectName = "cucumberProject"; boolean runWithJenkins = false; boolean parallelTesting = true; Configuration configuration = new Configuration(reportOutputDirectory, projectName); // optional configuration - check javadoc configuration.setRunWithJenkins(runWithJenkins); configuration.setBuildNumber(buildNumber); // addidtional metadata presented on main page configuration.addClassifications("Platform", "Windows"); configuration.addClassifications("Browser", "Firefox"); configuration.addClassifications("Branch", "release/1.0"); // optionally add metadata presented on main page via properties file /*List classificationFiles = new ArrayList(); classificationFiles.add("properties-1.properties"); classificationFiles.add("properties-2.properties"); configuration.addClassificationFiles(classificationFiles);*/ ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration); Reportable result = reportBuilder.generateReports(); // and here validate 'result' to decide what to do // if report has failed features, undefined steps etc System.out.println("finished"); }
@NirajGupta
5 жыл бұрын
public static void generatePassFailPdfReport(){ //*****************for pass and failed scenario********************** Iterator it=FileUtils.iterateFiles(new File(path), null, false); HtmlToPdf h=HtmlToPdf.create(); List objs=Collections.synchronizedList(new ArrayList()); objs.add(HtmlToPdfObject.forUrl(path+"overview-features.html")); while(it.hasNext()){ File f=(File) it.next(); if(Files.getFileExtension(f.getAbsolutePath()).equalsIgnoreCase("html") && f.getName().startsWith("report-feature")){ System.out.println(f.getAbsolutePath()); objs.add(HtmlToPdfObject.forUrl(f.getAbsolutePath())); } } objs.add(HtmlToPdfObject.forUrl(path+"overview-failures.html")); for(HtmlToPdfObject htmlToPdfObject:objs){ h.object(htmlToPdfObject); } boolean success=h.convert("target//"+"sample_details_report.pdf"); System.out.println(success? "PDF report generated": "pdf report generation failed"); //***********************end here report for Failed******************** }
@NirajGupta
4 жыл бұрын
github.com/callnirajgupta/CucumberSelenium/blob/master/pom_parallel.xml