Saturday, February 7, 2015

Run soapUI project using ANT script

Following is the sample ANT script to run soapUI project. To run it, you need to copy all the jar files from soapUI installation folder and also add soapUI-xxx.jar from bin folder, and put them in the lib folder and add it to ant classpath.

This ant script support:
1. you can run test by specifying the paramters like suite name, url, user name, password etc.
2. by default it will run all the test cases in the project.
3. it will generate JUnit compatible report.

Please refer my github reporitory for the whole sample code.

<project name="WS-Test"  default="test" >
<property file=""/>
<property name="test.dir" value="test-results"/>
<property name="project.dir" location="project"/>

<target name="clean">
       <delete dir="${test.dir}"/>

<target name="init">
      <mkdir dir="${test.dir}"/>

<target name="test-with-properties" depends="init">
<java classname="" errorproperty="tests-failed" fork="yes" dir="${test.dir}">
 <arg line="-j -M -r -a -f${basedir}/${test.dir}"/>
 <arg value="-e${wsdl.url}"/>
 <arg value="-s${soapui.testsuite}"/>
 <arg value="${project.dir}/${soapui.project}"/>
 <arg value="-x${}"/>
 <arg value="-x${user.password}"/>
<fileset dir="lib" includes="*.jar"/>

<target name="test" depends="init">
<java classname="" errorproperty="tests-failed" fork="yes" dir="${test.dir}">
 <arg line="-j -M -r -a -f${basedir}/${test.dir}"/>
 <arg value="${project.dir}/${soapui.project}"/>
<fileset dir="lib" includes="*.jar"/>

<target name="test-single-project" depends="init">
<antcall target="run-single-test">
 <param name="project" value="${project.dir}/${soapui.project}"/>

<target name="run-single-test">
   <java classname="" errorproperty="tests-failed" fork="yes" dir="${test.dir}">
 <arg line="-j -M -r -a -f${basedir}/${test.dir}"/>
 <arg value="${project}"/>
<fileset dir="lib" includes="*.jar"/>

<target name="report">
<junitreport todir="${test.dir}">
 <fileset dir="${test.dir}">
<include name="TEST-*.xml"/>
 <report format="frames" todir="${test.dir}/reports/html"/>


Tuesday, February 3, 2015

RobotFramework tools installation guide

I used RobotFramework for more than half a year, I really love it.
Now I shared my installation guide.

Hope this will be helpful for any  Developers who are interested in RobotFramework, but don't have Python experiences.

Set up Robot framework Tool Chai

1. Install python
   download python 2.7.6

 add the python installation folder to the windows PATH environment variable, for example
2. Install pip
   download via
   open a command window via "run as admin", type:

   Add following into windows PATH environment variable:

3. Install robot framework
   pip install robotframework
4. Install selenium2library
   pip install robotframework-selenium2library

5. Install RIDE

  install wxPython  wxPython
  install through windows ride package win32 version
  Or install using pip
   pip install robotframework-ride
6. Install selenium webdriver client

   chrome driver:

   IE driver
unzip them and copy the exe files in c:\webdriver directory
set them to windows path


7. Test
   run pip list, then you should see following:

decorator (3.4.0)
docutils (0.11)
pip (1.5.6)
robotframework (2.8.5)
robotframework-ride (1.3)
robotframework-selenium2library (1.5.0)
selenium (2.42.1)
setuptools (5.1)
- open dos command, type

  then it will shows:
  [ ERROR ] Expected at least 1 argument, got 0.
  Try --help for usage information.

- RobotFramework installation doc

- RobotFramework Selenium2Library installation guide

- RIDE installation instructions:

- selenium2library keywords doc