[Webtest] Java Script Function is not recognized

Harold Flores webtest@lists.canoo.com
Mon, 15 May 2006 15:51:54 -0500

Hi All,

We are trying to implement a Canoo WebTest script for the login page of 
our application.
After invoking the click Login button step, we get a message about a non 
existing function saveUserName().
               <parameter name="taskName" value="clickButton"/>
               <parameter name="label" value="Login"/>
               <parameter name="description" value="Click the submit 
                   <failed duration="922"/>
               <parameter name="text" value="Warranty Claim System"/>
               <parameter name="taskName" value="verifyTitle"/>
               <parameter name="description" value="Home Page follows if 
login ok"/>
                   <notexecuted duration="0"/>
message="com.canoo.webtest.engine.StepFailedException: Step[clickButton 
"Click the submit button" (5/6)]: Script error loading page executing 
webtest at: clickButton TypeError: saveUserName is not a function, it is 
null. (event for HtmlForm[<form onsubmit="saveUserName(this); return 
method="post" id="loginForm">]#1)Source code:function () {[native code, 
arity=0]}, Step: ClickButton at 
C:\WCS\hendrickson-base-head\test\canoo\canoo-web-test.xml:45:  with 
(taskName="clickButton", label="Login", description="Click the submit 

The saveUserName() method is a java script function and it is present in 
the page as it follows:
<script type="text/javascript">
       function saveUsername(theForm) {
       var expires = new Date();
       expires.setTime(expires.getTime() + 24 * 30 * 60 * 60 * 1000); // 
sets it for approx 30 days.                        }

Is there a way to indicate to Canoo WebTest to recognize the java script 
function even it is enclosed between  comment tags ("<!--"  and "//-->")?

Thanks for any answer.