[Webtest] Canoo WebTest Tool ends in error during submission of form with data.

Arvind Joshi webtest@lists.canoo.com
Wed, 9 Jun 2004 11:43:02 +0530


Hi all,

I  was evaluating the Canoo WebTest Tool for automated testing of web =
applications.

I am "Cut - Pasting" the error message ,and the syntax , below.

After the error message , I have pasted the Actual Code ( xml file) =
which gave this error.

What I was trying to achieve:
1) Login to the Site , with username / password . It takes me to the =
Application page.
2) Click on one of the  tab of the Application (tab)  page . After that
3) Click on the link on the resultant page
4) The final pages has few fields, which I am trying to populate through =
the xml-code , and do a "submit"=20

The Steps 1 - 3 goes through fine.=20
But fails on the submission of the form with the data.

I would like to know :
1) Whether I had made any mistake ?
2) Is this functionality supported , by this product ?
3) Or is there any work-around for this?
4) The Submission of the form involves a call to "javascript". Is this a =
supported feature? If not, is there a way-around?

Thanks,

Arvind


I got the following error:

crmcw01:/export/home/crmcw1e>ant -buildfile Userid.xml -v
Apache Ant version 1.6.1 compiled on February 12 2004
Buildfile: Userid.xml
Detected Java version: 1.3 in: /opt/java1.3/jre
Detected OS: HP-UX
parsing buildfile /export/home/crmcw1e/WEBTESTHOME/webtests/Userid.xml =
with URI =3D file:///export/home/crmcw1e/WEBTESTHOME/webtests/Userid.xml
Project base dir set to: /export/home/crmcw1e/WEBTESTHOME/webtests
Build sequence for target `main' is [main]
Complete build sequence is [main, ]

main:

BUILD FAILED
Test step clicklink named "Click The Apply Link" failed with message "No =
link found in page =
http://crmcw01.us.oracle.com:6666/OA_HTML/amsProdCreatMain.jsp?jtfm0=3D_0=
_1_0_-1_f_nv_&jttst0=3D1000196_21706%2C21706%2C-1%2C0%2C&etfm1=3D&jfn=3DZ=
GF57ABF2209F6D73FB5A3487ED5417C3E10E019B03AA0C30903004E05D38019F1992B1D8C=
797A972BCE4A48DD2BE806A478&PAGE.OBJ.objType=3DPROD: label <Apply>, =
htmlId <null>"
        at =
com.canoo.webtest.ant.TestSpecificationTask.stopBuildIfNeeded(TestSpecifi=
cationTask.java:78)
        at =
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask=
.java:72)
        at =
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:301)
        at org.apache.tools.ant.Target.performTasks(Target.java:328)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
        at =
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
        at org.apache.tools.ant.Main.runBuild(Main.java:632)
        at org.apache.tools.ant.Main.startAnt(Main.java:183)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)


My Code is :[ Userid.xml]

<project name=3D"SimpleTest" basedir=3D"." default=3D"main">
   <taskdef =
file=3D"/export/home/crmcw1e/WEBTESTHOME/webtestTaskdefs.properties">
      <classpath>
         <fileset dir=3D"/export/home/crmcw1e/WEBTESTHOME" =
includes=3D"**/lib/*.jar" />
      </classpath>
   </taskdef>
   <target name=3D"main">
      <testSpec name=3D"myTest">
         <config
            showhtmlparseroutput=3D"true"
            host=3D"crmcw01.us.oracle.com"
            port=3D"6666"
            protocol=3D"http"
            saveresponse=3D"yes"
            basepath=3D"OA_HTML" />
         <steps>
    <invoke
    stepid=3D"goto start page"
    url=3D"jtflogin.jsp" />
 <setinputfield stepid=3D"set user name"
    name=3D"username"
    value=3D"mktmgr" />
 <setinputfield stepid=3D"set password"
    name=3D"password"
    value=3D"welcome" />
 <clickbutton
    label=3D"Go"
    stepid=3D"Click the submit button" />
 <verifytitle stepid=3D"Marketing Online : Home"
    text=3D"Marketing Online : Home"  />
      <clicklink stepid=3D"The Product Page"
         label=3D"Product"
         save=3D"mktmgr"
         href=3D"PAGE.OBJ.objType=3DPROD"/>
<verifytitle stepid=3D"Marketing Online : Products"
    text=3D"Marketing Online : Products"  />
     <clicklink stepid=3D"The Create Product Page"
         label=3D"Create Product"
         save=3D"CrProd"
         href=3D"jtfm0=3D_0_1_0_-1_f_"/>
 <verifytitle stepid=3D"Marketing Online : Create Product"
    text=3D"Marketing Online : Create Product"  />
        <setcheckbox stepid=3D"Click Service Radio Button"
            name=3D"AmsProductCreate.OBJ.itemSetupType"
            value=3D"S"
            checked=3D"true" />
 <setinputfield stepid=3D"set Product name"
    name=3D"AmsProductCreate.OBJ.productName"
    value=3D"Canoo Dream" />
<setinputfield stepid=3D"set Product Number"
    name=3D"AmsProductCreate.OBJ._JTFSKFF_INV_MSTK_101__"
    value=3D"4444" />
<setinputfield stepid=3D"set Owner Name"
    name=3D"AmsProductCreate.OBJ.ownerName"
    value=3D"Smith, Ms. Elizabeth" />
        <setselectfield
            stepid=3D"Set 1st MultiSelect value to KIT"
            name=3D"AmsProductCreate.OBJ.itemType"
            value=3D"K" />
<setinputfield stepid=3D"set Description"
    name=3D"AmsProductCreate.OBJ.description"
    value=3D"Buy Canoo Dream and get ANT Hill Free" />
     <clicklink stepid=3D"Click The Apply Link"
        label=3D"Apply"
        href=3D"#" />
         </steps>
      </testSpec>
   </target>
</project>

This is what is the (partly & broken) content of the source of the =
Actual HTML page ( where "form" with data , is submited ):
---------------------------
<!-- Local JavaScript functions go here -->
<script language=3D"JavaScript">
function createProduct()
{

  getField("ProductCreatForm","JTFValidateFlag").value =3D "Yes";
  doAsfAction("ProductCreatForm","CRE");
}

---------------------------
<tr>
  <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
  <td nowrap align=3D"right">
 =20
  <a onclick=3D"ProductCreatForm.reset();" href=3D"#">Clear</a>
  <a onclick=3D"createProduct()" href=3D"#">Apply</a>

  </td>
</tr>
-----------------------------
<form name=3D"ProductCreatForm" action=3D =
"amsProdCreatMain.jsp?jtfm0=3D_0_1_0_-1_f_nv_&jttst0=3D1000196_21706%2C21=
706%2C-1%2C0%2C&etfm1=3D&jfn=3DZG10B5C8BD02C701E4A27F7339D228E3D543C667C4=
98FD96CDFEE2A0E3BEF2A1EDB55BA0CBD33348989FB37F4EC8FC8CAC92&PAGE.OBJ.objTy=
pe=3DPROD"  method=3D"post">=20

--------------------------------------------------------------

Thanks is advance for any advice / suggestion / Solution.

Arvind



Arvind Joshi
Application & Industry Solutions
North America Industries=20