[prev in list] [next in list] [prev in thread] [next in thread] 

List:       htmlunit-user
Subject:    Re: [Htmlunit-user] Problems with dynamically generated HTML code
From:       Ewald Geschwinde <egeschwinde () gmail ! com>
Date:       2012-09-10 15:26:54
Message-ID: CANihPFS8kw+7eyhFsdqiMjrdkVpEoLaEUAHY3QAC-nRSifBE=g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


The problem is I test this on Firefox and it works correct.

Is there another way which the click can be made from the top window ?


2012/9/8 Roman Dushko <rodush@gmail.com>

> Yes, it can. You should look at what happens when you click the ELEM
> element, maybe you will even find a JS code (function or smth.) and it
> would become more obvious what is happening there.
>
>
> 2012/9/7 Ewald Geschwinde <egeschwinde@gmail.com>
>
>> Thank you I have discovered that it was not in generated code but in a
>> sub iframe (I have not designed the page ;) )
>>
>> I'm using now the following construct:
>>
>>   List<FrameWindow> window = page3.getFrames();
>>
>>    HtmlPage page3one = (HtmlPage) window.get(1).getEnclosedPage();
>>
>>    List<FrameWindow> window2 = page3one.getFrames();
>>
>>    HtmlPage page3final = (HtmlPage) window2.get(0).getEnclosedPage();
>>
>>   HtmlPage page4 =  page3final.getElementById("ELEM").click();
>>
>> The Elem href is found and clicked - But page4 is exactly the same as
>> page3final - Can it be that the iframe is only affected through the clik
>> and not the whole page?
>>
>>
>>
>> 2012/9/5 <rodush@gmail.com>
>>
>>>  Dear Ewald,
>>>
>>> you need to get a page enclosed in that IFRAME whether with help of
>>> page.getFrames().get({number of frame}).getEnclosedPage() or
>>> page.getWebWindows().get({number of web-window where the content of IFRAME
>>> is resides (zero-based)}).getEnclosedPage();
>>> But try the second approach at first, please.
>>>
>>>
>>> Wednesday, September 5, 2012, 2:43:07 PM, you wrote:
>>>
>>>
>>>  I have a problem that some Html cod eis generated from javascript in
>>> an Iframe.
>>>
>>> I have access to the IFrame but I cannot access the anchor with
>>> getElementById - IT return always null.
>>>
>>> Parameters I have changed for the webclient.
>>>
>>>     webClient.setUseInsecureSSL(true);
>>>     webClient.setJavaScriptEnabled(true);
>>>     webClient.getCookieManager().setCookiesEnabled(true);
>>>     webClient.setTimeout(10000);
>>>   webClient.waitForBackgroundJavaScript(10000);
>>>   webClient.waitForBackgroundJavaScriptStartingBefore(10000);
>>>
>>> Has anyone a simliar problem?
>>> Or is this not possible with Htmlunit?
>>>
>>>
>>> --
>>> Ewald Geschwinde
>>>
>>>
>>>
>>> *--
>>> With best regards,
>>> Roman Dushko
>>> skype: rodush
>>>
>>>  Rodush                            mailto:rodush@gmail.com<rodush@gmail.com>
>>> *
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> 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/
>>> _______________________________________________
>>> Htmlunit-user mailing list
>>> Htmlunit-user@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>>>
>>>
>>
>>
>> --
>> Ewald Geschwinde
>>
>>
>> ------------------------------------------------------------------------------
>> 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/
>> _______________________________________________
>> Htmlunit-user mailing list
>> Htmlunit-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>>
>>
>
>
> --
> With best regards,
> Roman Dushko
> http://rodush.com/
> skype: rodush
>
>
>
> ------------------------------------------------------------------------------
> 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/
> _______________________________________________
> Htmlunit-user mailing list
> Htmlunit-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>
>


-- 
Ewald Geschwinde

[Attachment #5 (text/html)]

<div>The problem is I test this on Firefox and it works \
correct.</div><div><br></div><div>Is there another way which the click can be made \
from the top window ?</div><div><br></div><div><br></div><div \
class="gmail_quote">2012/9/8 Roman Dushko <span dir="ltr">&lt;<a \
href="mailto:rodush@gmail.com" target="_blank">rodush@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Yes, it can. You should look at what happens when you click \
the ELEM element, maybe you will even find a JS code (function or smth.) and it would \
become more obvious what is happening there.<div>

<div><br><br><div class="gmail_quote">
2012/9/7 Ewald Geschwinde <span dir="ltr">&lt;<a href="mailto:egeschwinde@gmail.com" \
target="_blank">egeschwinde@gmail.com</a>&gt;</span><br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">


<div>Thank you I have discovered that it was not in generated code but in a sub \
iframe (I have not designed the page ;) )</div><div><br></div><div>I&#39;m using now \
the following construct:</div><div><br></div><div>







<p>  List&lt;FrameWindow&gt; window = page3.getFrames();</p>
<p><span>	</span><span>	</span>   HtmlPage page3one = (HtmlPage) \
window.get(1).getEnclosedPage();</p> <p><span>	</span><span>	</span>  \
List&lt;FrameWindow&gt; window2 = page3one.getFrames();</p> \
<p><span>	</span><span>	</span>   HtmlPage page3final = (HtmlPage) \
window2.get(0).getEnclosedPage();</p> <p>  HtmlPage page4 =  \
page3final.getElementById(<span>&quot;ELEM&quot;</span>).click();</p></div><div><br></div>The \
Elem href is found and clicked - But page4 is exactly the same as page3final - Can it \
be that the iframe is only affected through the clik and not the whole page?<div>



<br></div><div><br><br><div class="gmail_quote">2012/9/5  <span dir="ltr">&lt;<a \
href="mailto:rodush@gmail.com" \
target="_blank">rodush@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div>



<div>
<span style="font-family:&#39;Courier New&#39;;font-size:9pt">Dear Ewald,<br>
<br>
you need to get a page enclosed in that IFRAME whether with help of \
page.getFrames().get({number of frame}).getEnclosedPage() or \
page.getWebWindows().get({number of web-window where the content of IFRAME is resides \
(zero-based)}).getEnclosedPage();<br>




But try the second approach at first, please.<div><div><br>
<br>
Wednesday, September 5, 2012, 2:43:07 PM, you wrote:<br>
<br>
</div></div></span><div><div><table>
<tbody><tr>
<td bgcolor="#0000ff" width="10"><br>
</td>
<td width="721"><span style="font-family:&#39;courier new&#39;;font-size:9pt">I have \
a problem that some Html cod eis generated from javascript in an Iframe.<br> <br>
I have access to the IFrame but I cannot access the anchor with getElementById - IT \
return always null.<br> <br>
Parameters I have changed for the webclient.<br>
<br>
    webClient.setUseInsecureSSL(true);<br>
    webClient.setJavaScriptEnabled(true);<br>
    webClient.getCookieManager().setCookiesEnabled(true);<br>
    webClient.setTimeout(10000);<br>
  webClient.waitForBackgroundJavaScript(10000);<br>
  webClient.waitForBackgroundJavaScriptStartingBefore(10000);<br>
<br>
Has anyone a simliar problem?<br>
Or is this not possible with Htmlunit?<br>
<br>
<br>
-- <br>
Ewald Geschwinde</span></td>
</tr>
</tbody></table>
<br><br>
<br>
<br>
</div></div><span><font color="#888888"><span \
style="font-family:&#39;arial&#39;;color:#c0c0c0"><i>-- <br> With best regards,<br>
Roman Dushko<br>
skype: rodush<br>
<br>
 Rodush                            <a style="font-style:normal" \
href="mailto:rodush@gmail.com" \
target="_blank">mailto:rodush@gmail.com</a></i></span></font></span></div>


<br></div></div>------------------------------------------------------------------------------<br>
 Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today&#39;s security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" \
target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>_______________________________________________<br>
 Htmlunit-user mailing list<br>
<a href="mailto:Htmlunit-user@lists.sourceforge.net" \
target="_blank">Htmlunit-user@lists.sourceforge.net</a><br> <a \
href="https://lists.sourceforge.net/lists/listinfo/htmlunit-user" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/htmlunit-user</a><br> \
<br></blockquote></div><span><font color="#888888"><br><br \
clear="all"><div><br></div>-- <br>Ewald Geschwinde<br> </font></span></div>
<br>------------------------------------------------------------------------------<br>
 Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today&#39;s security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" \
target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>_______________________________________________<br>
 Htmlunit-user mailing list<br>
<a href="mailto:Htmlunit-user@lists.sourceforge.net" \
target="_blank">Htmlunit-user@lists.sourceforge.net</a><br> <a \
href="https://lists.sourceforge.net/lists/listinfo/htmlunit-user" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/htmlunit-user</a><br> \
<br></blockquote></div><br><br clear="all"><br>-- <br>With best regards,<br>Roman \
Dushko<br></div></div><a href="http://rodush.com/" \
target="_blank">http://rodush.com/</a><br>skype: rodush<br><br> \
<br>------------------------------------------------------------------------------<br>
 Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today&#39;s security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" \
target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>_______________________________________________<br>
 Htmlunit-user mailing list<br>
<a href="mailto:Htmlunit-user@lists.sourceforge.net" \
target="_blank">Htmlunit-user@lists.sourceforge.net</a><br> <a \
href="https://lists.sourceforge.net/lists/listinfo/htmlunit-user" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/htmlunit-user</a><br> \
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Ewald Geschwinde<br>



------------------------------------------------------------------------------
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/

_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/htmlunit-user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic