[Webtest] Onblur event handler not fired

Marc Guillemot webtest@lists.canoo.com
Mon, 11 Apr 2005 10:18:43 +0200


Hi,

as far as I know htmlunit doesn't executed onblur code currently. You can look at htmlunit source code to improve it.

Marc.

vikrams@mastek.com wrote:
> Hi All,
> 
> I had a problem with the webtest verification.
> 
> In the code given below I have two input fields effDate and expDate.
> 
> There is a JavaScript code on the onblur event of the effDate to change 
> the contents of expDate to the Current Date
> 
> But when I do setInputfield for effDate with some date. The value in 
> expDate doesn’t change and the further verification of the expected 
> effDate fails.
> 
> That means the onblur event is not getting fired.Any suggestions or bug 
> fixes are welcome.
> 
> Below is the code for the Html and Javascript  and also for WebTest  
> test script.
> 
> Html Page Code
> 
> =====================================
> 
> <%@ page language= "Java"%>
> 
> <html>
> 
> <head>
> 
> <SCRIPT LANGUAGE="JavaScript">
> 
> function setExpDate(dateField) {
> 
>         document.forms[0].expDate.value = "01/04/2006";
> 
>         document.forms[0].expDate.focus();
> 
> }
> 
> </SCRIPT>
> 
> </head>
> 
> <body>
> 
> <FORM METHOD=POST ACTION="_http://webtest.canoo.com_" name="frmName" 
> onsubmit="return true;">
> 
> <input type="text" name="effDate" maxlength="10" tabindex="7" 
> value="00/00/0000" onblur="setExpDate(this)" style="width: 125 px;">
> 
> <input type="text" name="expDate" maxlength="10" tabindex="8" 
> value="00/00/0000" style="width: 125 px;">
> 
> <input type="text" name="hi" maxlength="10" tabindex="6" value="hi" 
> style="width: 125 px;">
> 
> <input type="hidden" name="promptForSave" value="true">
> 
> </FORM>
> 
> </body>
> 
> </html>
> 
> ======================================
> 
> Script
> 
> ======================================
> 
>   <steps>
> 
>     <invoke url="OnBlurTestRg.jsp" stepid=""/>
> 
>     <setinputfield name="effDate" value="01/04/2005" stepid=""/>
> 
>     <setinputfield name="hi" value="bye" stepid=""/>
> 
>     <verifyinputfield name="expDate" value="01/04/2006" stepid="Could 
> not verify expriy date"/>
> 
>   </steps>
> 
> ======================================
> 
> Error
> 
> Caught exception: The following error occurred while executing this line:
> 
> E:\WebTest\OnBlurCheck.xml:19: Test failed.
> 
> Test step verifyinputfield (E:\WebTest\OnBlurCheck.xml:35: )  named 
> "Could not verify expriy date" failed with message "Step "verifyinput
> 
> field "Could not verify expriy date" (5/6): Wrong contents found in 
> input field:
> 
>  expDate Expected <01/04/2006> but got <00/00/0000>"
> 
> ======================================
> 
> */Thanks & Regards/*/////
> /Vikram Shitole
>  
> 
> */"No one knows what he can do till he tries."/*
> 
> 
> 
> 
> MASTEK
> "Making a valuable difference"
> Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
> In the US, we're called MAJESCO
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Opinions expressed in this e-mail are those of the individual and not 
> that of Mastek Limited, unless specifically indicated to that effect. 
> Mastek Limited does not accept any responsibility or liability for it. 
> This e-mail and attachments (if any) transmitted with it are 
> confidential and/or privileged and solely for the use of the intended 
> person or entity to which it is addressed. Any review, re-transmission, 
> dissemination or other use of or taking of any action in reliance upon 
> this information by persons or entities other than the intended 
> recipient is prohibited. This e-mail and its attachments have been 
> scanned for the presence of computer viruses. It is the responsibility 
> of the recipient to run the virus check on e-mails and attachments 
> before opening them. If you have received this e-mail in error, kindly 
> delete this e-mail from all computers.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~