Soap UI Assertions

In this post I am going to explain what assertion in soapui is and how we can apply script assertion.

Assertion

Assertion functionality in SoapUI is used to validate the response of request received by the Test Steps at the time of execution. Usually assertion is to compare a part of message (or the entire message) to some expected value.
Assertion applied in SoapUI at response of request, if any assertion failed then test marked as failed. Failed test can be verify and find out the reason.

Data driven testing using java webdriver TestNg framework

In this post I implemented that how to perform data driven testing using java Webdriver  TestNg framework. As we know testNg provide @DataProvider annotation, using this I can pass a set of data into our Webdriver test method.  I have created a sample test script for Wikipedia where I use a set of country data, with Wikipedia search functionality and verify searched country.

Ant build tool

Apache Ant is java based library and command line tool. Ant drive application using build xml file, control behavior of build, compile and run targets define in build xml file.

Basically ant build is a java based application. It can be Also  build non java applications such as C, C++, PHP, Python etc by passing their compile/interpreter. Ant is written in java so ant user can be develop their own library. Ant is easy to use it does not impose coding convention or directory layouts to the java projects.

Ant use a configuration xml file, default name of file is build.xml. ant directly call target define in build file. Targets can be define their dependencies, ant will automatically execute dependent target.

Here is a sample of ant buid.xml file.

Screen Recording (Video) of Java Webdriver script

Sauce lab provided screen capturing functionality to test scripts execution, I was looking same type functionality to work on local machine and came up across “Monte Media Library” java based library developed by Werner Randelshofer.. In this post I have described a way to capture screen cast/ Video recording of selenium/webdriver test script execution.

Step to implement Monte Media library to selenium/Webdriver test scripts.
  1. Download “MonteScreenRecorder.jar” from link http://www.randelshofer.ch/monte/
  2. Add this jar file to your selenium/webdriver eclipse project.
  3. This jar file contain “ScreenRecorder” class, we need to create this class object by following way.

Sikuli Firefox Webdriver

Sikuli launched new API for java based programming language frameworks. This API provide image based GUI automation.  The new java library API has re-designed  and included several new functions that were not available in original sikuli script. Such as the ability match color. Handle events and fund geometric patterns such as rectangular button.  It can be integrated with maven build.

Requirements
  1. Java Runtime Environment(JRL) or Java Development Kit (JDK) version 1.6 or newer.
  2. Apache maven version 2.0.10 or newer if you want to build it from maven.
Supported Platform:
  1. Windows 7 (64/32 bits) 
  2. Mac OS X(64 bits)
  3. Linux (64 bits).

Watir Ruby Based Automation Tool

About Watir:
:
Watir is an open source,  ruby based automation tool for web application. Watir drives application on web similar type as user do. It click on browser, fill form data, press button etc. Also it check result such as when any text appear on page.
Using ruby programming language we can make connection to data base, read files(csv, xls, txt, xml etc.) We can create our own function and library for reusable code.

Webdriver C# test scripts execution using Grid2

Nunit framework is not support parallel execution of driver test scripts using Grid. If we use MbUuit framework then we can accomplish parallel execution of test scripts against Grid2. For set up MbUnit you can see “MbUnit Framework

Test scripts setup :
  1. Add reference Gallio and  MbUnit ddl file to your Webdriver project from installed Gallio folder.
  2. Add below code in project’s  “AssemblyInfo.cs” file.
using MbUnit.Framework;

[assembly:DegreeOfParallelism(2)]
[assembly:Parallelizable(TestScope.All)]
       3. We need to add below code for MbUnit framework in test scripts.
using MbUnit.Framework;

add [Parallelizable] annotation on test case lavel ass I added in belowtest scripts.
       4. I have created two test one “GridTest1.cs” file for internet explorer and “GridTest2.cs” file for firefox  browser.

C# WebDriver with MbUnit Framework

Set Up C# Webdriver with MbUnit and Gallio:
  1. Download and install Gallio from link ‘http://gallio.org/Downloads.aspx’
  2. Add reference Gallio and  MbUnit ddl files to webdriver project from installed Gallio folder.

Parameterization in soap ui using soap ui property feature

Sometimes we need to use some values in several times in our api test, such as api end point, api methods name, user name, password etc. If these values we put in place and use these values when needed in our test. If these values changed then we need to update only a single place.

In SoapUI we can use parametrization from external files of property feature of SoapUI.

Parametrization using SoapUI properties:


 In soapui properties can be created at three level
  1.     Test Case
  2.     Test Suite
  3.     Project.    
Click on created test case. Click on properties tab at bottom of soapUI.
Click on + icon and enter property name.

As I created a property for endpoint url .


Similarly we can create properties for Test Suite and Project level..

How to use:
  1.     ${#TestCase#EndPoint} for test case property.
  2.     ${#TestSuite#EndPoint} for test suite property.
  3.     ${#Project#EndPoint} for project property.

Soap UI API (HTTP Test request) testing for beginner

About Soap UI:

Soap UI is a free and open source cross-platform Functional Testing solution. With an easy-to-use graphical interface, and enterprise-class features, Soap UI allows you to easily and rapidly create and execute automated functional, regression, compliance, and load tests. In a single test environment, Soap UI provides complete test coverage and supports all the standard protocols and technologies. There are simply no limits to what you can do with your tests.

Soap UI testing area:

SOAP UI is basically used for API testing, below are some areas of  SOAP UI testing.
  1. Functional Testing.
  2. Load testing.
  3. Service mocking 
  4. Security Testing.
  5. Http protocol request testing.
  6. SOAP and WSDL
  7. Rest API testing.
  8. JMS API testing.
  9. AMF type API testing.
  10. WEB and HTTP.
Procedure- test HTTP type API method.

Download and install Soap UI from url “sourceforge.net/projects/soapui/files/”.
Go to start >All Programs > SmartBear >soap UI *.*.*   and click on Soap UI-*.*.*
You should see Soap UI will open on machine.