Hi Prasanna,
your xpath are not the cause of the problem but clicking the element
triggers some script that causes the error. At some place is a function
named "validate" called but it isn't defined.
If no js error occurs in a normal browser, then it means, that it is a
problem in htmlunit.
Normally you should see the javascript calls in the stacktrace on the
console. This should help to see where this validate method is called
and to understand why htmlunit doesn't like it.
Marc.
Prasanna wrote:
**
Hi
I am using
*Web test* *Build: R_1366*
**
My HTML Source Looks Something like
<td><a href="#"
onClick="submitForm('edit_properties.aspx?survey_no=17&do=temppg')"
onMouseOver="MM_swapImage('Image3','','../AllImages/ImagesGreyGold/general/t-edittmp2.gif',1)"
onMouseOut="MM_swapImgRestore()"><img
src="../AllImages/ImagesGreyGold/general/t-edittmp1.gif" name="Image3"
border="0" id="Image3"></a></td>
<td><a href="#"
onClick="submitForm('edit_properties.aspx?survey_no=17&do=errpg')"
onMouseOver="MM_swapImage('Image4','','../AllImages/ImagesGreyGold/general/t-custerror2.gif',1)"
onMouseOut="MM_swapImgRestore()"><img
src="../AllImages/ImagesGreyGold/general/t-custerror1.gif" name="Image4"
border="0" id="Image4"></a></td>
Now From Xpath Explorer I get the xpath for these elements as
*//table/tbody/tr/td[4]/a*
*//table//tbody/tr/td[2]/table//tbody/tr/td[6]/a*
Respectively
I use *clickElement* with xpath as both mentioned above
I get the Correct Page in case where xpath is
*"//table//tbody/tr/td[2]/table//tbody/tr/td[6]/a*"
but get Script Error with xpath as *"//table/tbody/tr/td[4]/a*"
*Script error loading page executing webtest at: clickElement Wrapped
com.gargoylesoftware.htmlunit.ScriptException: *
*TypeError:*
* validate is not a function, it is null. *
*(event for HtmlBody[<body ms_positioning="GridLayout" leftmargin="0"
topmargin="0" onload="setTemplate();FontPreview();validate();">]#1) *
*(Embedded script in
**http://beta.zarca.com/zSM/edit_properties.aspx?survey_no=17#115**) *
*Source code: function () { [native code, arity=0] } , Step:
ClickElement at C:\build\bin\betaSMProperty.xml:32: with
(resultFilename="response_1155797320543_clickElement.html",
taskName="clickElement", xpath="//table/tbody/tr/td[4]/a")*
Please Let me know what can be done if I want to Proceeed Furthur as I
am getting* Script Error* on many other ClickEvents on the site we are
testing ..
Please Let me know How To Proceed with Testing ...
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest