Experience & exploration about software QA tools & techniques. Maintaining & writing blog posts on qavalidation.com! Publishing video tutorials on youtube.com/qavbox

Combine TestNGListener with log4j for selenium result reporting

This post will explain the integration of any java logger (let’s say Log4j) with ITestListener to customise result output and print the same to log file. We have seen testNG and it’s listener ITestListener to customise the result output.   Watch details here Log4j maven dependency Use below dependency – <!– https://mvnrepository.com/artifact/log4j/log4j –> <dependency> <groupId>log4j</groupId>…

TestNG Listener – customise output with ITestListener

TestNG provides many listeners (as interfaces) which you can customise to your need to get output more readable. Here are the listeners – IAnnotationTransformer IAnnotationTransformer2 IHookable IInvokedMethodListener IMethodInterceptor IReporter ISuiteListener ITestListener Source – TestNG Listeners From this above listeners, in this post we will see ITestListener ITestListener interface has the following methods to implement void…

Protractor Logging – console output – print to log file

Protractor Console output As protractor is built on top of webdriver JS, we should resolve promise while printing to console output. so below statement doesn’t work console.log(“Browser title :- ” + browser.gettitle()); instead, you can use browser.getTitle().then(function(txt){ console.log(“Browser Title :- ” + txt); }); watch details here Protractor log to file As protractor is a…