Posts

Showing posts from July, 2008

Web application testing in Ruby(Watir) - 2 minutes guide

Watir (pronounced as Water) is a free open source tool which can be used to automate web applications. It is an extension of Ruby programming language. Unlike most of the other testing tools it gains the advantage of powerful features of Ruby and simulate browser interactions in very simple manner. Lets see how a simple google search is automated using Watir in few steps. Pre-requisites Install Ruby (1.8.5-24 or later) Step 1 Install Watir. Open a command window or shell and issue the following commands gem update --system gem install watir The above two commands update gem installer and then install watir in your system. Step 2 Open SciTE ruby editor or notepad and start to create the following script. require "watir" ie = Watir::IE.new ie.goto("http://www.google.com") ie.text_field(:name, "q").set("WSO2 WSAS") ie.button(:name, "btnG").click Step 3 Save the above file as SimpleTest.rb and run it from the command line by typing Simp...

How to validate a WSDL using Eclipse

When you create a wsdl file from scratch or use an already designed one, you must make sure it is valid. In other words it should; consist of well-formed XML (All tags should be closed and nested properly) conform to XML Schema comply with the rules and standards defined in WSDL specification valid with the rules defined by WS-I (Web services interoperability organization) Eclipse Web tools project (WTP) provides a very useful tool which validates a wsdl against above rules/standards. Lets see how we can validate an existing wsdl using Eclipse wtp. 1. Download and install Eclipse wtp 2. Open eclipse IDE 3. Start to create a new wsdl (File --> New --> other --> Web Services --> WSDL) 4. Give a name to the wsdl (you can provide the name of wsdl which needs to be validated) and click on next. Accept the default options and click on Finish. 5. You will see a design view of a new wsdl file. Move to source view by selecting "Source" tab. 6. You will see an skeleton so...

Apache JMeter book is published

Image
There are no much books available on test automation and tools. In order to fill the void in the software testing bibliography, Emily H. Halili decided to put together the basic concepts of test automation and performance testing with JMeter . This book was designed to pave the path for readers to get detailed insight on JMeter as well as a basic reference guide. I was the technical reviewer of this book. It consists of 140 pages and 8 chapters, starts with a short introductory chapter on advantages of test automation and requirements of automated tests. Chapter 2 focuses on an overview of JMeter followed by setting up environment and installation. Chapter 4, The Test Plan shows you all the parts of JMeter test plan. It explains all elements of test plan and how they interact together. Use of Jmeter in load/performance testing is demonstrated in chapter 5. In chapter 6, you will get information on the tools in JMeter that support functional or regression testing. Chapter 7 and 8 desc...

How to deploy Apache Axis2 on WebLogic 10

Image
I have already discussed the steps to deploy Apache Axis2 on IBM WebSphere , JBoss and Resin application servers. In this post, I'm going to explain the procedure to deploy Axis2 on BEA Weblogic 10 server. Pre-requisites: Download and install BEA Weblogic 10. Step1 Create a new weblogic domain by running config.sh located at WebLogic_HOME/wlserver_10.0/common/bin directory. Lets assume the new domain is axis2. Access your weblogic domain direcrtory and start weblogic (Go to WebLogic_HOME/user_projects/domains/axis2/bin and run startWebLogic.sh) Step 2 Download Axis2.war from here Step 3 Create a directory in your file system (i.e:- /opt/axis2) and copy axis2.war to that directory. Extract axis2.war file (unzip axis2.war) Step 4 Access WebLogic administration console (In a browser, access http://localhost:7001/console) Log in to administration console (You should have configured username and password for admin console when creating your WebLogic domain) Step 5 In the left naviga...

How to use Axis2 codegen ANT task

Apache Axis2 code generator tool provides a very useful custom ANT task. All of the command line code generation options are available with the ANT task as well. Lets see how a simple client side code generation is done using the ANT task. Pre-requisites: Install Apache Axis2 -1.3 or higher Install Apache ANT-1.7 or higher Step 1 Create a directory and start to create a build.xml inside that as given below. (eg:- C:\temp\build.xml) <project name="CodegenExample" default="codegen" basedir="."> <path id="axis2.classpath"> <fileset dir="C:\axis2\axis2-1.4\lib"> <include name="**/*.jar" /> </fileset> </path> <target name="codegen"> <taskdef name="axis2-wsdl2java" classname="org.apache.axis2.tool.ant.AntCodegenTask" classpathref="axis2.classpath"/> <axis2-wsdl2java wsdlfilename="C...

How to access HTTP headers from an Axis2 service implementation class

I have seen some users in axis user mailing list ask the question on how to access HTTP headers of the request SOAP message using the service implementation class. It's easy and straightforward with messageContext class. Lets see with an example. 1. Create a service implementation class as follows import javax.servlet.http.HttpServletRequest; import org.apache.axis2.context.MessageContext; public class TestService { public String MyOperation(String s){ MessageContext msgCtx = MessageContext.getCurrentMessageContext(); HttpServletRequest obj =(HttpServletRequest)msgCtx.getProperty("transport.http.servletRequest"); System.out.println("Acceptable Encoding type: "+ obj.getHeader("Accept-Encoding") ); System.out.println("Acceptable character set: " +obj.getHeader("Accept-Charset")); System.out.println("Acceptable Media Type: "+obj.getHeader("Accept")); return s; ...

How to monitor messages using tcpmon in Axis2 dual channel web service invocation

Image
Apache Axis2 client API provides the necessary methods to utilize a service using two transport channels. You can even send request through one transport (e.g:- HTTP) and get the response back via a different transport such as TCP. setUseSeperateListener( boolean ) method of org.apache.axis2.client.Options class can be used to utilize a separate listener for your response. If two separate HTTP transport channels are used for request and response, Axis2 starts a new HTTP listener at the client side to receive the incoming response message. As most of web service developers know, Apache tcpmon can be used to monitor message flow between web service invocations. In one way messaging, it is quite straightforward. You just need to configure tcpmon to listen in some port and direct the messages to the port where the web service is hosted. In client, port of the endpoint reference has to be changed to tcpmonitor listen port. That's all you have to do for monitoring messages in singl...

How to Deploy Apache Axis2 on IBM WebSphere

Image
As I mentioned in a previous post , the flexible deployment mechanism of Axis2 allows you to install it on any application server with minimum configuration effort. Lets see how Axis2 can be deployed on IBM WebSphere . Pre-requisites: Download and install IBM WebSphere 6.1 Create a profile as specified in the WebSphere installation steps I will use Axis2-1.4 and WebSphere6.1 for demonstration purposes. But you should be fine with the other versions too. Step 1 Download Axis2.war from here Step 2 Start WebSphere server (In windows XP menu All programs--> IBM WebSphere-->Application Server 6.1 --> profiles --> YourProfile -->Start the Server) Wait until start window closes. Step3 Access WebSphere administration console (In windows XP menu All programs--> IBM WebSphere-->Application Server 6.1 --> profiles --> YourProfile-->Administrative Console) Log in to administration console (You should have configured username and password for admin console when crea...

WSDL2Code UI tool - Easy and efficient code generation utility

Image
If you are an Apache axis2 user, you may already familiar with WSDL2Java code generation tool. WSO2 WSAS is powered by Apache Axis2 and includes a rich set of features to interact with web services. WSDL2Code is a UI based tool integrated with WSO2 WSAS which allows users to generate code from a WSDL hosted in a remote server or a local file system. Lets see how WSDL2Code tool makes web service developement effort much easier and productive. Step 1 Download and Install WSO2 WSAS Step 2 Start wso2wsas. Go to WSAS_HOME/bin and run wso2wsas.bat{sh} Step 3 Go to http://localhost:9762 Welcome page of the WSAS console will be displayed. Click on WSDL2Code at the left navigation menu. You will be directed to the following screen. You can see multiple code generation options in the above screen. These code gen options are similar to the command line options available in WSDL2java tool. Step 4 Lets generate client stub against default version service using the above tool. Enter 'http...