Hi,

currently <setInputField.../> only triggers onchange as far as I remember.
We can't assume that it should trigger onkeyXXX because value may be set for
instance with the mouse but onblur makes sense to me. Could you open an
issue for that (a minimal example to include in the selftests would be
great).

In the mean time, with a recent webtest build (using HtmlUnit-1.13) as
workaround, you can do something like:
<groovy>
step.context.currentResponse.getHtmlElementById('yourId').fireEvent("blur")
</groovy>
The best solution is probably to pack it together with the
<setInputField...> in a macro to reuse it easily.

Marc.


Luke.Templin wrote:
> 
> I'm running webtest against an asp.net page that uses javascript to
> update the next row in an existing table. But the event that fires the
> calculation doesn't occur:
> 
>  
> 
> Here's what the test looks like
> 
> <invoke description="ScheduleInput" url="/Schedule/ScheduleInput.aspx"
> />
> 
>         <setInputField htmlId="txtSchedDt" value="11/04/2007" />
> 
>         <clickButton htmlId="btnSearch" />
> 
>         <setInputField description="enter StartMW" value="1150"
> htmlId="dgGeneratorForecasts__ctl0_dgForecast_11315__ctl2_txtsegmentStar
> tMW" />
> 
>         <setInputField description="enter EndMW" value="1000"
> htmlId="dgGeneratorForecasts__ctl0_dgForecast_11315__ctl2_txtsegmentEndM
> W" />
> 
>         <setInputField description="enter Duration Hour" value="3"
> htmlId="dgGeneratorForecasts__ctl0_dgForecast_11315__ctl2_txtDurationHr"
> />
> 
>         <setInputField description="enter Duration Minute" value="00"
> htmlId="dgGeneratorForecasts__ctl0_dgForecast_11315__ctl2_txtDurationMin
> " />
> 
>         <setInputField
> htmlId="dgGeneratorForecasts__ctl0_dgForecast_11315__ctl2_txtsegmentComm
> ent" value="test comment" saveResponse="true"/>
> 
>         <verifyText description="start time should indicate extra hour"
> text="02:00" />
> 
>  
> 
> The table elements code as rendered by IIS/ASP are typically:
> 
> td style="background-color:Wheat;">
> 
> <input
> name="dgGeneratorForecasts:_ctl0:dgForecast_11315:_ctl2:txtsegmentStartM
> W" type="text"
> id="dgGeneratorForecasts__ctl0_dgForecast_11315__ctl2_txtsegmentStartMW"
> onBlur="javascript:updateEndMW('dgForecast_11315')"
> style="background-color:Wheat;border-style:None;width:40px;text-align:ri
> ght;" />
> 
>  
> 
> where the javascript is triggered by the onBlur event.
> 
>  
> 
> The last screen saved doesn't show the values entered by the
> setInputField tasks.
> 
>  
> 
> Any suggestions?
> 
>  
> 
> Luke Templin
> 
> 
> 
> 
> -----------------------------------------
> **************************************************
> This e-mail and any of its attachments may contain Exelon
> Corporation proprietary information, which is privileged,
> confidential, or subject to copyright belonging to the Exelon
> Corporation family of Companies. 
> This e-mail is intended solely for the use of the individual or
> entity to which it is addressed.  If you are not the intended
> recipient of this e-mail, you are hereby notified that any
> dissemination, distribution, copying, or action taken in relation
> to the contents of and attachments to this e-mail is strictly
> prohibited and may be unlawful.  If you have received this e-mail
> in error, please notify the sender immediately and permanently
> delete the original and any copy of this e-mail and any printout.
> Thank You.
> **************************************************
> 

-- 
View this message in context: 
http://www.nabble.com/javascript-within-page-tf4417970.html#a12609033
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to