How to give dynamic file name in the appender in log4j.xml

In log4j.xml define variable as ${variable}: Then make sure you set the system property when you start your JVM such as: java -Dlogfilename=my_filename example.Application That will create a dynamic log file name: my_filename.log Alternatively, you can set the system property in code so long as you do it before you create a logger (this is useful … Continue reading How to give dynamic file name in the appender in log4j.xml

Changing HTTP headers for a Selenium WebDriver request

There are two ways to tackle this : Using a Firefox browser extension that would modify the headers for you Using a reverse proxy, like the Browser Mob Proxy The BMP is complicated especially if you are behind a corporate proxy. So modify headers extension is the approach we can use. Loading the extension Just … Continue reading Changing HTTP headers for a Selenium WebDriver request

Gradle – How to Display Test Results in the Console in Real Time

Problem Statement: Most of the times we would like to see test results ( system.out/err, log messages from components being tested ) as they run in the same console I run: And not wait until tests are done to look at the test reports. Solution :  OR We can use Gradle Test Logger Plugin to … Continue reading Gradle – How to Display Test Results in the Console in Real Time