TESTNG: how to send emailable report as an email selenium-webdrivertestng what is the best way to send test reports as an email? My framework has WebDriver + TestNG Best Answer For Jenkins.. Go to Your Project > Configure > Post-build Actions > Editable Email Notification. Then click on Advanced Settings.... There is a box named Pre-send Script. def reportPath = build.getWorkspace().child("test-output/emailable-report.html") msg.setContent(reportPath.readToString(), "text/html"); Copy that and paste it into the box. Then Save it. That will generate the colourfull page and you can send it as a report via email. Related SolutionsPython – Get HTML source of WebElement in Selenium WebDriver using Python You can read the innerHTML attribute to get the source of the content of the element or outerHTML for the source with the current element. Python: element.get_attribute('innerHTML') Java: elem.getAttribute("innerHTML"); C#: element.GetAttribute("innerHTML"); Ruby: element.attribute("innerHTML") JavaScript: element.getAttribute('innerHTML'); PHP: $element->getAttribute('innerHTML'); It was tested and worked with the ChromeDriver. Related Topic
Best Answer
For Jenkins..
Go to Your
Project > Configure > Post-build Actions > Editable Email Notification
.Then click on
Advanced Settings....
There is a box named Pre-send Script.
Copy that and paste it into the box. Then Save it. That will generate the colourfull page and you can send it as a report via email.