Today I want to talk about a little tool which makes the life of us testers a bit easier.
It is called Junit params.

The  following situation happened with me not so long ago:
The dev team lead asked us a favor to make a set of quick and dirty smoke tests which tests different sites and check if some elements are present.
There are of course different approaches, if we are lucky the function is already automated and documented somewhere, and we just have to make it accessible and runnable by others too.

My a quick and dirty method is to copy my base webdriver project in which i have an already prepared test base file with the bare minimum for webdriver, i add the necessary pageobjects, then all we need to do is to create a junit test and add some parameters. For adding parameters, i prefer JUnit params. It is a a lightweigth tool, which extend Junit’s parametrization runner.

public class SampleTestClass  {
WebDriver driver;

// the trick is very simple, just define the parameters values as an array
"" })
// String website will be the variable which will contain the parameter values
public void sampleTest(String website) {
driver = new ChromeDriver();


// check if logo element is present on the page
WebDriverWait driverWait = new WebDriverWait(driver, 10);




For more details and example checkout the JUnit params project on GitHub: