Road to command line execution of soapUI project

We run SoapUI project using SoapUI GUI interface.  SoapUI also provide set off batch files to execute soapUI tests from command line without using SoapUI GUI interface.

Following are the runner scripts inside installed SoapUI bin folder.
1. testrunner.bat : this is use to run functional test using command line.
2. loadtestrunner.bat: This is used to run soapui load testing using command line.
3. mockservicerunner.bat:  This is used to run soapui mock services using command line.
4. toolrunner.bat: This is used to launch soapui tools.
5. securitytestrunner.bat: This command is used to run security tests

Road to integration of calabash android test with Jenkins

In this post I am going to show you how to integrate calabash android test with Jenkins continuous integration for build. Also I will show you how to publish cucumber execution report in Jenkins.

Installation:
1. Java: java should be installed
2. Jenkins: If you are new to Jenkins then click link "click here” of my post how to setup Jenkins in window before continue.
3. Install the”cucumber-jvm-reports-java” plugin: following are the steps to install plugin.

Road to performance testing using soapUI

In this post I would like to show you performance testing of webservices using soap ui.
Performance testing of web services is not just running SOAP or XML messages in a loop to run the service. It should be a well-planned activity which must be aligned with the performance expectations of the overall service-oriented solution.  You can run multiple type of performance test such as SOAP , JSON, XML format messaging through a single interface
SoapUI allows users to configure various load testing options such as delays in between threads to simulate real-world use cases and run tests in burst mode to stress test services.

Some Important SoapUI functions in groovy script.

In this post I will show you some important soapui functions which are basically used in soap ui groovy scripts.

1. Following functions are used to read properties in soapui project.
projectPropertyValue = context.expand( '${#Project#Test}')

projectPropertyValue = context.expand( '${#TestCase#Test}')

projectPropertyValue = context.expand( '${#TestSuite#Test}'

I have create three properties with name "Test" at project, testsuite and test case level. Using above code we can read values in groovy scripts and can be use where needed.
2. Setting properties value test case.
def myTestCase = context.testCase

myTestCase.setPropertyValue("Name", “Value”)

3. Reading end url value of any test steps. Replace your test step name with “TestStepName”
EndPointUrl  = context.getProperty("TestStepName","Endpoint")
4. Setting parameter value of test steps. Replace you test step name, parameter name and value with “TestStepName”, “dataSet” and “value”.
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)

//set data parameter value in TestStep
groovyUtils.setPropertyValue("TestStepName", "dataSet", “value”)
Will continue adding more function

Road to capture clip of element locator in webdriver java

In this post I am going to show you how to capture clip of page element using webdriver.
Below I have written a “CaptureElementClip.java“java webdriver test script of a google application where I capture google menu clip and save into project.

package com.webdriver.test;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.Point;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;

public class CaptureElementClip {

        private WebDriver driver;
        private String baseUrl;

        @BeforeSuite
        public void setUp() throws Exception {
                    driver = new FirefoxDriver();
                    baseUrl = "http://google.com";
                    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
         }

        @Test
        public void testGoogle() throws IOException {

                    //open application url
                    driver.get(baseUrl);

                    //take screen shot
                    File screen = ((TakesScreenshot) driver)
                                        .getScreenshotAs(OutputType.FILE);
                                        
                    //get webelement object of google menu locator
                    WebElement googleMenu = driver.findElement(By.id("gbz"));
                    Point point = googleMenu.getLocation();

                    //get element dimension
                    int width = googleMenu.getSize().getWidth();
                    int height = googleMenu.getSize().getHeight();
                   
                    BufferedImage img = ImageIO.read(screen);
                    BufferedImage dest = img.getSubimage(point.getX(), point.getY(), width,
                                                                                 height);
                    ImageIO.write(dest, "png", screen);
                    File file = new File("Menu.png");
                    FileUtils.copyFile(screen, file);
          }

          @AfterSuite
          public void tearDown() throws Exception {
                    driver.quit();
           }
}

After executing above test a “Menu.png” file is generated in root folder of your project.

Road to run selenium test on custom Firefox profile

Following are the steps to create Firefox profile and launch selenium server.
1. Click start button >> Go to Run.
2. Type firefox.exe –P and click on OK button.

Road to data driven testing webdriver C# with Nunit

In this post I will show you how to implement data driven testing in webdriver C# using Nunit.
I put all data in xml file and fetch data during execution time of test. For data I have created data.xml file list country.

Road to screen recording in webdriver with C#

Last couple of days, I am searching screen recording by using webdriver with C# similar to “Monte Media Library” in java and finally I got the solution. Here, I am posting my finding so that it can help others.
For screen capturing Microsoft provide” Microsoft Expression Encoder 4” which can be download and install from link “http://www.microsoft.com/en-in/download/confirmation.aspx?id=27870

Default installation directory is “C:\Program Files\Microsoft Expression”.

Steps to create and run webdriver test.

1. You need to make sure that you have setup all required dll for of webdriver and Nunit.
2. Download and install”Microsoft Expression Encoder 4” from above mentioned url.
3. Add “Microsoft.Expression.Encoder.dll” from “C:\Program Files\Microsoft Expression\Encoder 4\SDK” folder to your webdriver project.

Road to automate android application using Robotium and Testdroid recorder.

In this post I will show you how to automate android application using robotium framework with testdroid recorder.
Testdroid recorder is capture user action , generate reusable android test case into robotium framework. For more detail about Testdroid visit link “click here

Prerequisites: 
  1. Eclipse should be installed in your machine.
  2. Android SDK should be installed.
  3. ADT Plug-in installed in to Eclipse. 
Testdroid installation: 

1. Start Eclipse and go to Help -> Install New Software
2. Click Add button; enter to field asking you a site to work with.
3. Fill in “Testdroid plug-in” for the Name
4. For the Location provide URL to Testdroid repository:  http://www.testdroid.com/updates/
5. Click ok button.

Road to setup and execute webdriver test scripts on android emulator

Prerequisites:

Following prerequisites you need to set up before starting.
1. Android SDK must be installed and setup path in your machine and virtual device should be created. For more detail how to setup and create virtual device visit my post “Road to create virtual android device( emulator ) in windows
2. Download selenium server and “android-server-2.32.0.apk” from link “Android server” and save in your machine.
3. Launched your avd device (emulator)

Installation of Webdriver APK into emulator: 

1. Put android “android-server-2.32.0.apk” file under “platform-tools” of installed android directory.
2. Run below command on console to check available devices.
adb  devices
Like below message displayed on your console.
D:\Android\android-sdk\platform-tools>adb devices
List of devices attached
emulator-5554   device

3. Go to “platform-tools” folder of installed android directory and run below command to install android server into mentioned emulator (device) id.
adb -s {{emulator-id}} -e install -r  android-server-2.32.0.apk

exp:
adb -s emulator-5554  -e install -r  android-server-2.32.0.apk 
Android driver installed into mentioned driver and you can see into your emulator