Posts

Showing posts with the label Selenium

How to raise a Defect in JIRA using Java Program

We always wonder that we have Test scripts to send an Email report to all the stakeholder with extensive report with count of Passed and failed after test suite execution but no logical test script to log the defect for the failed test cases in the Test management Tool. It might not affect much if we are working in conventional methodology like waterfall, protype etc. But we are in the level of deploying the products by adhering to the Continuous Delivery and Continuous Deployment process. So, to cope up the automation activities with the product deployment, the Product management tool – Jira provides an additional feature of updating/defect logging using test scripts by providing REST Api. Now we will look the implementation of Defect logging script, Pre-requisites :  Need below mentioned two Jars files in the build class path. Apache HttpClient 4.5.3 API - https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5.3 jersey-client.jar - http:/

Junit Parallel Run Program

Below is the sample helper class needed to run parallel JUnit test: package default; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.junit.runners.Parameterized; import org.junit.runners.model.RunnerScheduler; public class Parallelized extends Parameterized {       private static class ThreadPoolScheduler implements RunnerScheduler {     private ExecutorService executor;         public ThreadPoolScheduler() {       String threads = System.getProperty("junit.parallel.threads", "16");       int numThreads = Integer.parseInt(threads);       executor = Executors.newFixedThreadPool(numThreads);     }         @Override     public void finished() {       executor.shutdown();       try {         executor.awaitTermination(10, TimeUnit.MINUTES);       } catch (InterruptedException exc) {         throw new RuntimeException(exc);       }