Road to create executable jar using maven

In this post I explained the procedure to create executable jar file using maven build tool.

You need to create java maven project using eclipse.

Here is example of a java class having main method.

Road to create executable jar using ant build tool

In this post I explained the procedure to create executable jar file using ant.

You need to create java project using eclipse , create a lib folder in your eclipse project.

Here is example of a java class having main method.

Road to verify images using java webdriver

In this post I have explained that how to verify images in webdriver using java. As webdriver does not provide direct any function to image verification, but we can verify images by taking two screen shots of whole web page using “TakesScreenshot” webdriver function, one at script creation time and another at execution time,

In below example I have created a sample script in which first I captured a Google home page screen shot and saved (GoogleInput.jpg) into my project, Another screen shot “GoogleOutput.jpg” captured of same page at test executing time and saved into project. I compared both images if they are not same then test will script fail.

Road to verify 200 response code of web application in java webdriver

This post will help to verify HTTP response code 200 of web application using java webdriver. As webdriver does not support direct any function to verify page response code. But using "WebClient" of HtmlUnit API we can achieve this.

Html unit API is GUI less browser for java developer, using WebClent class we can send request  to application server and verify response header status.

Below code, I used in my webdriver script to verify response 200 of web application

 String url = "http://www.google.com/";
 WebClient webClient = new WebClient();
 HtmlPage htmlPage = webClient.getPage(url);

 //verify response
 Assert.assertEquals(200,htmlPage.getWebResponse().getStatusCode());
 Assert.assertEquals("OK",htmlPage.getWebResponse().getStatusMessage());

Road to accept certificates in internet explorer using webdriver

One of my projects, I need to verify application certificates during test case execution . It was working fine on firefox and google chrome browser as webdriver automatically accept certificate.  But Internet Explorer webdriver was not accepted automatically after doing a lot of observation, finally I got solution by navigating below java script code with webdriver object.

 driver.navigate().to("javascript:document.getElementById('overridelink').click()");

Road to verify PDF file text using java webdriver

In this post I will explain the procedure to verify PDF file content using java webdriver. As  some time we need to verify content of web application pdf file, opened in browser.
Use below code in your test scripts to get pdf file content.

Jenkins Hudson

Jenkins is an open source continuous Integration tool written in java originated by Hudson.  Jenkins is most popular continuous integration tool in market. The reason is Jenkins is easy to use, open source, intuitive user interface and powerful features, supported variety of languages, technologies including Java .net, PHP, Ruby, Python, and Groovy etc.

Junit Test with Maven

In this post I will explain how to create and run JUnit test using maven. download Apache maven from link “download”, extract zip package into you machine and setup path maven bin folder into your system  environment variable. following are the steps to create JUnit test for maven and maven commands.

JUnit Test creation:

Create source folder in your eclipse “src/test/java” and “src/main/java” as below screen:

Procedure to run AutoIt script using ant (build.xml) tool.

In this post I will cover the procedure of AutoIT script execution with the help of ant build tool. As we know ant has java based library. But here I have set AutoIT compiler with Ant's build.xml file and can execute AutoIT scripts
  1. Ant path must be set in to system environment variable.
  2. AutoIT installation directory path must be set in to system environment variable.
    Below is a sample build.xml file for AutoIT script execution.

PHP Selenium RC data driven testing

In this post I will cover the procedure of data driven testing in selenium RC with phpunit framework.  PHP unit provide @dataProvider provider annotation.

In this post I have created a data driven test script in phpunit on Wikipedia where I put some country data in to excel file.