Posts

Showing posts from 2015

QC Scheduler VB Script

Every one aware about Quality Center and its inbuilt QC Scheduler functionality. I hope everyone has tried using this QC Scheduler functionality to execute their script at correct day and time. But after set this Time dependency they have to run the Test Set manually. This Test set waits till the day and time specified by user and then execution will start. The user who tried about surely frustrates of using the QC scheduler like this. So, the one who dislike the above functionality and want to execute or trigger the script and receive the automail. Here I have one stop solution to handle the execution of QC script and trigger the automail to the stake holder.  Basic steps are 1) Create a VB Script with the below mentioned script 2) Schedule the script in Windows Task Scheduler 'VBScript Document Option Explicit 'QC Paramters Dim Server, UserName, Password, QCDomain, QCProject, QCTestSetPath, QCTestSetName,QCTestSubject Server = "<QC path/qcbin>"

FitNesse Program

Sample FitNesse program, package com.SamplePackage; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.ie.InternetExplorerDriver; public class FirstClass { WebDriver driver; //Constructor method public FirstClass(String browser, String baseURL) {     if (browser.equalsIgnoreCase("*iexplore"))     {         driver = new InternetExplorerDriver();         driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);     }     else if (browser.equalsIgnoreCase("*firefox"))     {         driver = new FirefoxDriver();     }     else if (browser.equalsIgnoreCase("*chrome"))     {         driver = new ChromeDriver();     } } public boolean open(String URL) { driver.get(URL);   

Browsermob Sample Program

//Import dependency classes from Selenium standlone jar file import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; //Import dependency classes from BrowserMob-Proxy jar file import org.browsermob.proxy.ProxyServer; import org.browsermob.core.har.Har; import org.openqa.selenium.By; import org.openqa.selenium.Proxy; import java.io.FileOutputStream; public class SampleClass {     public static void main(String[] args) throws Exception {         String strFilePath = "< Define Your Local System Path here >";         // start the proxy         ProxyServer server = new ProxyServer(4444);         server.start();         //captures the moouse movements and navigations         server.setCaptureHeaders(true);         server.setCaptureContent(true);         // get the Selenium proxy object         Proxy proxy = server.seleniumProxy();         /

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);       }