From: Raj S. S. <raj...@im...> - 2010-03-15 16:28:36
|
Thanks a lot, I think should work. Regarding the nesting I'm keeping my fingers crossed. From: jason franklin-stokes [mailto:jas...@go...] Sent: Monday, March 15, 2010 9:13 PM To: htm...@li... Subject: Re: [Htmlunit-user] problem with frames As far as I am aware a frame is a frame regardless of how it was made (javascript or html code) I don't think you will be able to find out how the frame was made - only that it is there. I am assuming that the form you want to look for stays the same, i.e. you can always identify it by some attribute - it just keeps moving around frames. If that is the case, why don't you just iterate over all the frames and look for the form? **** sloppy pseudo code example **** frames = page.getFrames frames.each {|frame| frames << frame} frames.each {|frame| if frame.getEnclosedPage.getElementsByName("name of form") then "Found by Form" } I dont think frames can be too nested - I have tested with a depth of 8 and everything works out ok. Hope that helps Jason. On Mar 15, 2010, at 4:05 PM, Raj Singh Sisodia wrote: Hi All, My apologies if this question has been asked before, but even after a thorough search I could not find any related post. I am tiring to develop an application which would populate some HTML forms and submit them. The form I am interested in deep into the frame/frameset hierarchy, where the frames are defined using javascript, something like this <html> <head> <script language="JavaScript" src="/js/OCW.js"> </script> <title> Some title... </title> <script language="JavaScript"> //<![CDATA[ function... //]]> </script> </head> <frameset rows="69,*" cols="*" framespacing="0" frameborder="NO" border="0"> <frame src="/tf.jsp" name="tF" scrolling="NO"/> <frame src="/OC.do?task=fl" name="mF" scrolling="default"/> </frameset> </html> These frames have other frames as children defined in same format and somewhere it will contain the needed form. Now I am aware that I can get the frame data by using page.getFrameByName(frameName).getEnclosedPage() but this approach has two problem 1. Too many deeply nested frames 2. The site changes its implementation without notifying the users, so the application may fail anytime. So what I want is a method through which I can access the forms without explicitly calling the frames. Is it possible and if yes how. Regards, ________________________________ Impetus Technologies is participating at the CTIA Wireless 2010 from 23rd to 25th March 2010. Meet Impetus in Las Vegas to experience our mobile and wireless domain expertise. Click http://impetus.com/events to know more. Follow our updates on www.twitter.com/impetuscalling<http://www.twitter.com/impetuscalling>. NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev_______________________________________________ Htmlunit-user mailing list Htm...@li...<mailto:Htm...@li...> https://lists.sourceforge.net/lists/listinfo/htmlunit-user ________________________________ Impetus Technologies is participating at the CTIA Wireless 2010 from 23rd to 25th March 2010. Meet Impetus in Las Vegas to experience our mobile and wireless domain expertise. Click http://impetus.com/events to know more. Follow our updates on www.twitter.com/impetuscalling. NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference. |