Sorry for my misunderstanding. Could you please open an issue in Sourceforge project tracker [1]. I feel we could use "type" when appropriate in order that setTextField() triggers onkeyxx events. This way you would not be forced to expose JWebUnit internal implementation.
Regards, Julien [1] http://sourceforge.net/tracker/?limit=25&func=&group_id=61302&atid=497982&assignee=&status=&category=&artgroup=&keyword=&submitter=&artifact_id=&assignee=&status=1&category=&artgroup=&submitter=&keyword=&artifact_id=&submit=Filter >________________________________ > De : S.R.G. Manoj <mano...@hotmail.com> >À : "jwebunit-users@lists.sourceforge.net" ><jwebunit-users@lists.sourceforge.net> >Envoyé le : Mercredi 26 septembre 2012 12h29 >Objet : Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email >found in subject > > > >@Julien - The problem was not with onchange event, onchange event was getting >triggered perfectly. The problem was with events like onkeyup, onmousedown, >onkeypress. The solution given by Rajinder worked fine for my issue. > >@Rajjnder - Thanks for the solution, it worked perfectly fine . > >Regards, >Manoj > > >> Date: Wed, 26 Sep 2012 15:32:42 +0530 >> From: rsin...@seasiaconsulting.com >> To: henr...@yahoo.fr; jwebunit-users@lists.sourceforge.net >> Subject: Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email >> found in subject >> >> Dear Julien, >> >> I had similar case in which the Button was enabled when I type something in >> the textbox, I tried various combination but casting to htmlunit and typing >> in the text box worked for me. >> >> In my case t was keyupevent and keypress events. >> >> Regards >> Rajinder >> >> -----Original Message----- >> From: Julien HENRY [mailto:henr...@yahoo.fr] >> Sent: Wednesday, September 26, 2012 3:33 PM >> To: Usage problems for JWebUnit >> Subject: Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events -Email >> found in subject >> >> @Rajinder Do you really need to cast to HtmlUnit specific implementation? >> >> @Manoj Can you try to click on another element (for example a div) after >> setting text in order to trigger the onchange event? >> >> >> Regards, >> >> Julien >> >> >> >________________________________ >> > De : Rajinder Singh <rsin...@seasiaconsulting.com> >> >À : Usage problems for JWebUnit <jwebunit-users@lists.sourceforge.net> >> >Envoyé le : Mercredi 26 septembre 2012 9h33 >> >Objet : Re: [JWebUnit-users] [HCSPAM] - Triggering javascript events - >> >Email found in subject >> > >> > >> > >> >You can use this: >> > >> > >> HtmlUnitElementImpl htmlUnit = (HtmlUnitElementImpl) getElementById("xxx"); >> > try{ >> > setTextField("otpTokenPin", ""); >> > >> htmlUnit.getHtmlElement().type(“gfhghf”); >> > >> } catch(Exception e) { >> > >> e.printStackTrace(); >> > >> } >> > >> htmlUnit = (HtmlUnitElementImpl) getElementById("ddd"); >> > try{ >> > >> htmlUnit.getHtmlElement().click(); >> > >> } catch(IOException >> e1) { >> > >> e1.printStackTrace(); >> > >> } >> > >> > >> >From:S.R.G. Manoj >> [mailto:mano...@hotmail.com] >> >Sent: Wednesday, September 26, 2012 11:22 AM >> >To: jwebunit-users@lists.sourceforge.net >> >Subject: [HCSPAM] - [JWebUnit-users] Triggering javascript events - >> Email found in subject >> > >> >Hi, >> > >> >Can we trigger a javascript event using jWebUnit? >> >In my case i have a onkeyup event for a text box and when i this event is >> triggered a button needs to be enabled, >> >but when i set the value for the text box using >> 'setTextField("textfieldName","value") the event is not >> getting triggered. >> > >> > >> >Thank you! >> > >> >Regards, >> >Manoj >> >DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with >> >it contain confidential, copyright, proprietary and legally privileged >> >information. It should not be used by anyone who is not the original >> >intended recipient. Any use, distribution, copying or disclosure by any >> >other person is strictly prohibited. If you receive this transmission in >> >error, please notify the sender by reply email and then destroy the >> >message. Opinions, conclusions and other information in this message that >> >do not relate to official business of Seasia Consulting and its >> >subsidiaries, Internet communications cannot be guaranteed to be timely, >> >Secure, error or virus-free. The sender does not accept liability for any >> >errors or omissions." >> >Use GROTAL.COM - Make Life Easy ....... ( Like us on Facebook, See us on >> >Youtube ) >> >------------------------------------------------------------------------------ >> >Live Security Virtual Conference >> >Exclusive live event will cover all the ways today's security and >> >threat landscape has changed and how IT managers can respond. Discussions >> >will include endpoint security, mobile security and the latest in malware >> >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> >_______________________________________________ >> >JWebUnit-users mailing list >> >JWebUnit-users@lists.sourceforge.net >> >https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> > >> > >> > >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWebUnit-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users >> >> DISCLAIMER AND PRIVILEGE NOTICE: This e-mail and any files transmitted with >> it contain confidential, copyright, proprietary and legally privileged >> information. It should not be used by anyone who is not the original >> intended recipient. Any use, distribution, copying or disclosure by any >> other person is strictly prohibited. If you receive this transmission in >> error, please notify the sender by reply email and then destroy the message. >> Opinions, conclusions and other information in this message that do not >> relate to official business of Seasia Consulting and its subsidiaries, >> Internet communications cannot be guaranteed to be timely, Secure, error or >> virus-free. The sender does not accept liability for any errors or >> omissions." >> >> Use GROTAL.COM- Make Life Easy !!! >> >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> JWebUnit-users mailing list >> JWebUnit-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jwebunit-users > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >JWebUnit-users mailing list >JWebUnit-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jwebunit-users > > > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ JWebUnit-users mailing list JWebUnit-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jwebunit-users