From: Vinay M. <vin...@gm...> - 2004-10-15 16:06:46
|
Hi, I used htmlunit to log onto a site having a couple of frames. To confirm that I am at the right page, I tried dumping (HtmlPage)page.asText() and I ended up with a message "Frames are required. Microsoft IE 3.0 or greater and Netscape 2.0 or greater support frames." Can somebody help me around two issues please ? 1. asText() should return me the page as it is seen in the browser. This I presume is the html of the page. Can I be validated here ? 2. I believe I havent been able to successfully get to the page I needed because of the frames. Is there a way to get around this too ? Thanks a lot, Best Regards Vinay P.S: for the benefit of the list, I did like to mention that, https connections fail on older versions of j2sdk 1.4. SSL support comes intergrated with 1.4, but apparently certain Verisign certificates included there have expired. Therefore it would be better to upgrade to the latest j2sdk version available(1.4.2_06). Otherwise we might end up with an exception saying "no trusted certificate found" |
From: Raj S. S. <raj...@im...> - 2010-03-15 15:21:35
|
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. 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. |
From: jason franklin-s. <jas...@go...> - 2010-03-15 15:43:21
|
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. > > 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... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
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. |
From: Mike B. <mb...@Ga...> - 2004-10-16 00:31:42
|
Vinay Murthy wrote: > I used htmlunit to log onto a site having a couple of frames. To > confirm that I am at the right page, I tried dumping > (HtmlPage)page.asText() and I ended up with a message "Frames are > required. Microsoft IE 3.0 or greater and Netscape 2.0 or greater > support frames." > > Can somebody help me around two issues please ? > 1. asText() should return me the page as it is seen in the browser. > This I presume is the html of the page. Can I be validated here ? Right, although it appears that we haven't added specific handling for the noframe tag. > 2. I believe I havent been able to successfully get to the page I > needed because of the frames. Is there a way to get around this too ? The content for the frames has most likely already been loaded. You can call getEnclosedPage() on the HtmlFrame instance to get at the content inside that frame. > P.S: for the benefit of the list, I did like to mention that, https > connections fail on older versions of j2sdk 1.4 Interesting. I'll have to remember that one. -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |