Hi Marc,

Thanks for replying. From what i have gathered, Web services is a rest-based
and outputting JSON as the expected output. I have played around with
webtest with invoke contentfile and Webtest does recognise the output.
However, at the moment management is more inclined to use JMETER for this
purpose as we need to connect to mysql via JDBC in order to clean up the
database prior to running the test. I find JMETER to be really basic in
terms of functional web testing as it is more towards performance testing

I need to present to the management the benefit of using Webtest for this
web services testing. I have managed to use SQLunit to connect mysql via
JDBC , however I have not figured out how to incorporate SQLUnit inside
webtest script (I have just managed to run SQL unit individually by telling
it to output webtest report by this command:ant sqlunit-nested canoo2html
-Dtestdir=testwedi -Dlog.format=canoo -Doutput.file=results.xml
-Dwebtest.style=WebTestReport

Lets say I have the following simple webtest script:

<!DOCTYPE project SYSTEM "../dtd/Project.dtd">

<project default="test">


    <target name="test">


        <dataDriven tableContainer="testsip.xls" table="testjson">


        <webtest name="check soap">
        <config haltonerror="false" haltonfailure="false"  >

         <option name="ThrowExceptionOnScriptError"
        value="false"
        />
              <option name="ThrowExceptionOnFailingStatusCode"
        value="false"
        />
        <header name="User-Agent" value="Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"/>

     </config>




   <invoke method="GET" url="${URL}"/>

     <applyFilters>

        <matchLinesFilter regex="\d"/>
        </applyFilters>


          <verifyContent referenceFile="json.html"/>


</webtest>
</dataDriven>
</target>
</project>

And I have the following simple SQLunit script:

  <test name="Checking returned value from customer"
          failure-message="Returned value check for customer failed">
    <sql>
      <stmt>SELECT category_alias_name FROM
Fads_ForQARnD.category_alias_to_c1_category_mappings where
category_alias_name ='Banking'</stmt>

    </sql>
    <result>
      <resultset id="1">
        <row id="1">
          <col id="1" name="category_alias_name"
type="VARCHAR">Banking</col>
        </row>
      </resultset>
    </result>

How can i incorporate SQLunit script inside webtest script so webtest will
run SQLunit script firstly and then running subsequent webtest script?

Thanks
  </test>

Reply via email to