Posts

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:/

Methods of easily debugging/fixing the scripts with known facts - Part2

Version mismatch of Installed Java, compiled Java project and Eclipse IDE. I have listed issues by high priority 1)        Eclipse - 32 bit , Java 8 64 bit 2)        Eclipse - 32 bit, Java 7 32 bit but the project is mapped to Java 6 path 3)        Wrongly pointed out of the Java bin path in the Path environment variable led to not able to open Eclipse IDE. If we try to open, it will throw exit code 13. 4)        java.lang.UnsupportedClassVersionError or Unsupported major.minor version 52.0 Happens because of using Higher JDK during compile time and lower JDK during runtime.                                 The issue 1 and 4 can be fixed by upgrading/degrading of either Eclipse or Java.The reported number in the error message is the requirednumber, not the number we are using. The reported major numbers with the required versions are,                                 Java SE 9 = 53,                                 Java SE 8 = 52,                             

Methods of easily debugging/fixing the scripts with known facts - Part1

Network proxy issue in the Firefox browser – we can handle the proxy issue in two ways a)        Fixing the issue outside the script – i.e., creating the Firefox Profile and set the proxy how we need and map it to the Selenium web driver script. By saying it looks easy. But the problem will start, Firefox profile Java class not able to get the correct intended Profile. This issue will happen if we have installed our Firefox browser outside the “c:/program files” folders. How we can resolve this issue? Yes, I do have workaround for this problem. We can achieve this by doing Method overriding. Here we need to override the method getPofiles of the class profileIni. Let see the code implementations, //Setting the firefox.exe file path File pathToBinary = new File (“<Firefox.exe file path>”); FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary); //overriding the profilepath ProfilesIni profile = new ProfilesIni() { @Override public FirefoxProfile ge

Selenium IDE test suite execution on all browsers

Whenever, we start working with Selenium IDE. Everyone says,                  “The Selenium IDE is the plugin of Firefox and we can easily record & play back but it is restricted to that specific browser - Firefox” So, do you want to believe like that? What if, there is an option to leverage our Selenium IDE test suite and execute on different browsers. Yes, we have an option to execute our Selenium IDE suite on IE, Google chrome, safari browsers.  Let’s see the steps, a) Create a test suite in Selenium IDE and name it as “sample.html” b) Download latest selenium standalone jar file c) Set the browser executable file in the environment variable. If you like to execute the script on Google chrome browser then create the environment variable as "webdriver.chrome.driver" in the system and store the path of the chrome driver executable file d) Please create batch/shell script file to execute the below command java -jar .\selenium-server-standal

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