Capture SS in log and email.
I am able to capture ss in Extent Report Log in POM framework but when I sent the .html file for review the image is not found. How to overcome this issue?
In this case, you can zip the directory and send the content.
Meaning to I need to send the entire project everytime for reporting. I was send a zip file which had 2 folders, one with the .html file and other with ss. The code top capture ss I used from your POM Module.
public void takeScreenShot(WebDriver webdriver , ExtentTest test ) throws InterruptedException{ Thread. sleep (2000); Date d = new Date(); String screenshotFile = d .toString().replace( ":" , "_" ).replace( " " , "_" )+ ".png" ; String filePath = System. getProperty ( "user.dir" )+ "\\ExtentReports\\screenshots \\" + screenshotFile ; // store screenshot in that file File scrFile = ((TakesScreenshot) webdriver ).getScreenshotAs(OutputType. FILE ); } try { FileUtils. copyFile ( scrFile , new File( filePath )); } catch (IOException e ) { // TODO Auto-generated catch block e .printStackTrace(); } test .log(LogStatus. INFO , test .addScreenCapture( filePath ));
No, we have code for zipping and mail. Discussed in Module 24. You'll get to know how you can zip the report contents and mail these
We offer online selenium and UFT/QTP training. The course is very comprehensive and covers every aspect of automation testing with UFT/QTP and selenium. All types of frameworks are covered in depth - data driven framework, hybrid framework, page object model with a live project
© 2020 Whizdom Trainings. All rights Reserved - Powered by Whizdom Trainings