message /confirm box in htmlunit

View: New views
8 Messages — Rating Filter:   Alert me  

message /confirm box in htmlunit

by s e-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Sorry for me stupid questions but  i am learning by doing an I searched a lot on the internet some how i cant find all my answers. 

I try to test a website i stuck on the save confirmBox  example: i wrote a text and hit the save button , next an confirm box appears it says "Are you sure" , i have 2 options:
hit OK or Cancel , but  i cant acces the confirm button s ? how to acces it so that i can hit OK button.
Sorry for my english.

Gr,
Said 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: message /confirm box in htmlunit

by Ahmed Ashour :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Please read:
 
 


From: s e <said.ennahachi@...>
To: htmlunit-user@...
Sent: Mon, October 19, 2009 3:32:04 PM
Subject: [Htmlunit-user] message /confirm box in htmlunit

Hi,

Sorry for me stupid questions but  i am learning by doing an I searched a lot on the internet some how i cant find all my answers. 

I try to test a website i stuck on the save confirmBox  example: i wrote a text and hit the save button , next an confirm box appears it says "Are you sure" , i have 2 options:
hit OK or Cancel , but  i cant acces the confirm button s ? how to acces it so that i can hit OK button.
Sorry for my english.

Gr,
Said 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Problem to handle "&nbsp;"

by Andreas Korzinowski-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

With the anchor.getTextContent() - method i get the text from an link.
But sometimes this text contains the noblankspace ( ) sign. This
looks
like a normal blank, but it isn´t.
When i compare strings from the getTextContent-Method with .equals or with
"==", the answer
is false, because the strings are different.
Is there anyone who had resolved this problem in a dapper way ?

Is there a way to replace the   to a normal blank ?

Greetings
Andreas

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: Problem to handle " "

by Ahmed Ashour :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Andreas,
 
And based on what you consider &nsbp; = ' '?
 
The below test case shows that real browsers treats them differently.
 
<html><head><script>
function test() {
  alert(document.getElementById('mydiv').firstChild.nodeValue.charCodeAt(0));
}
</script></head><body onload='test()'>
<div id='mydiv'>&nbsp;</div>
</body></html>
Yours,
Ahmed 
----
Blog: http://asashour.blogspot.com

From: Andreas Korzinowski <andreas@...>
To: htmlunit-user@...
Sent: Wed, October 21, 2009 12:07:48 PM
Subject: [Htmlunit-user] Problem to handle " "


Hello,

With the anchor.getTextContent() - method i get the text from an link.
But sometimes this text contains the noblankspace (&nbsp;) sign. This
looks
like a normal blank, but it isn´t.
When i compare strings from the getTextContent-Method with .equals or with
"==", the answer
is false, because the strings are different.
Is there anyone who had resolved this problem in a dapper way ?

Is there a way to replace the &nbsp; to a normal blank ?

Greetings
Andreas

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: Problem to handle " "

by Kumararaja Gunasekaran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

Have you tried to call trim() , replaceAll("&nbsp;",""); before doing any string manipulation

 

Thanks,

Kumar.

From: Ahmed Ashour [mailto:asashour@...]
Sent: 21 October 2009 11:27
To: htmlunit-user@...
Subject: Re: [Htmlunit-user] Problem to handle " "

 

Hi Andreas,

 

And based on what you consider &nsbp; = ' '?

 

The below test case shows that real browsers treats them differently.

 

<html><head><script>
function test() {
  alert(document.getElementById('mydiv').firstChild.nodeValue.charCodeAt(0));
}
</script></head><body onload='test()'>
<div id='mydiv'>&nbsp;</div>
</body></html>

Yours,

Ahmed 

----
Blog: http://asashour.blogspot.com


From: Andreas Korzinowski <andreas@...>
To: htmlunit-user@...
Sent: Wed, October 21, 2009 12:07:48 PM
Subject: [Htmlunit-user] Problem to handle " "


Hello,

With the anchor.getTextContent() - method i get the text from an link.
But sometimes this text contains the noblankspace (&nbsp;) sign. This
looks
like a normal blank, but it isn´t.
When i compare strings from the getTextContent-Method with .equals or with
"==", the answer
is false, because the strings are different.
Is there anyone who had resolved this problem in a dapper way ?

Is there a way to replace the &nbsp; to a normal blank ?

Greetings
Andreas

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: Problem to handle " "

by Andreas Korzinowski-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank for your replay,

yes, i mean the & n b s p ; - Tag, but i wrote the mail with a
webmailer-frontend, and this filters this tag.

When i take the result from anchor.getTextContent() to Std-Output like:
System.out.println("Link is: " + link.getTextContent());
then it shows me a normal blank on the place, where in the html-source are
the noblankspace-signs. (In the Netbeans Output-Window)

A replaceall doesn´t work, because he tried to replace the
string-equivalent and not the html-signs.
Also trim() doesn´t work, because this is not a normal blank.

Exists there a special regex - method to replace the noblankspace-sign to
a normal blank for further handling ?

Greetings
Andreas

Am Mittwoch, den 21.10.2009, 12:31 +0200 schrieb Kumararaja Gunasekaran
<kumar@...>:

> Hi,
>
> Have you tried to call trim() , replaceAll(" ",""); before doing any
> string manipulation
>
> Thanks,
> Kumar.
> From: Ahmed Ashour [mailto:asashour@...]
> Sent: 21 October 2009 11:27
> To: htmlunit-user@...
> Subject: Re: [Htmlunit-user] Problem to handle " "
>
> Hi Andreas,
>
> And based on what you consider &nsbp; = ' '?
>
> The below test case shows that real browsers treats them differently.
>
> <html><head><script>
> function test() {
>  
alert(document.getElementById('mydiv').firstChild.nodeValue.charCodeAt(0));

> }
> </script></head><body onload='test()'>
> <div id='mydiv'> </div>
> </body></html>
> Yours,
> Ahmed
> ----
> Blog: http://asashour.blogspot.com
> ________________________________
> From: Andreas Korzinowski <andreas@...>
> To: htmlunit-user@...
> Sent: Wed, October 21, 2009 12:07:48 PM
> Subject: [Htmlunit-user] Problem to handle " "
>
>
> Hello,
>
> With the anchor.getTextContent() - method i get the text from an link.
> But sometimes this text contains the noblankspace ( ) sign. This
> looks
> like a normal blank, but it isn´t.
> When i compare strings from the getTextContent-Method with .equals or
with

> "==", the answer
> is false, because the strings are different.
> Is there anyone who had resolved this problem in a dapper way ?
>
> Is there a way to replace the   to a normal blank ?
>
> Greetings
> Andreas
>
>
------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and
stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Htmlunit-user mailing list
>
Htmlunit-user@...<mailto:Htmlunit-user@...>
> https://lists.sourceforge.net/lists/listinfo/htmlunit-user

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: Problem to handle " "

by Ahmed Ashour :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Andreas,
 
The discussion is getting in two directions:
 
    - Does HtmlUnit incorrectly behave, and a fix is needed? I don't think this is the case as of now.
    - Replacing the not-normal space, you can use string.replaceAll("\u00A0", " ");
 
Hope that helps,
 
Enjoy,
----
Blog: http://asashour.blogspot.com

From: Andreas Korzinowski <andreas@...>
To: htmlunit-user@...
Sent: Wed, October 21, 2009 1:59:53 PM
Subject: Re: [Htmlunit-user] Problem to handle " "


Thank for your replay,

yes, i mean the & n b s p ; - Tag, but i wrote the mail with a
webmailer-frontend, and this filters this tag.

When i take the result from anchor.getTextContent() to Std-Output like:
System.out.println("Link is: " + link.getTextContent());
then it shows me a normal blank on the place, where in the html-source are
the noblankspace-signs. (In the Netbeans Output-Window)

A replaceall doesn´t work, because he tried to replace the
string-equivalent and not the html-signs.
Also trim() doesn´t work, because this is not a normal blank.

Exists there a special regex - method to replace the noblankspace-sign to
a normal blank for further handling ?

Greetings
Andreas

Am Mittwoch, den 21.10.2009, 12:31 +0200 schrieb Kumararaja Gunasekaran
<kumar@...>:

> Hi,
>
> Have you tried to call trim() , replaceAll(" ",""); before doing any
> string manipulation
>
> Thanks,
> Kumar.
> From: Ahmed Ashour [mailto:asashour@...]
> Sent: 21 October 2009 11:27
> To: htmlunit-user@...
> Subject: Re: [Htmlunit-user] Problem to handle " "
>
> Hi Andreas,
>
> And based on what you consider &nsbp; = ' '?
>
> The below test case shows that real browsers treats them differently.
>
> <html><head><script>
> function test() {
alert(document.getElementById('mydiv').firstChild.nodeValue.charCodeAt(0));

> }
> </script></head><body onload='test()'>
> <div id='mydiv'> </div>
> </body></html>
> Yours,
> Ahmed
> ----
> Blog: http://asashour.blogspot.com
> ________________________________
> From: Andreas Korzinowski <andreas@...>
> To: htmlunit-user@...
> Sent: Wed, October 21, 2009 12:07:48 PM
> Subject: [Htmlunit-user] Problem to handle " "
>
>
> Hello,
>
> With the anchor.getTextContent() - method i get the text from an link.
> But sometimes this text contains the noblankspace ( ) sign. This
> looks
> like a normal blank, but it isn´t.
> When i compare strings from the getTextContent-Method with .equals or
with

> "==", the answer
> is false, because the strings are different.
> Is there anyone who had resolved this problem in a dapper way ?
>
> Is there a way to replace the   to a normal blank ?
>
> Greetings
> Andreas
>
>
------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and
stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Htmlunit-user mailing list
>
Htmlunit-user@...<mailto:Htmlunit-user@...>
> https://lists.sourceforge.net/lists/listinfo/htmlunit-user

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

Re: Problem to handle " "

by Andreas Korzinowski-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Ahmed,
the second way is a good workaround.
That resolves my problem.

Htmlunit works correct.
But with the often used way to look what html-code is behind an anchor
with the asXml()-method it is dizzling, when on Std-Output appears a
blank,
but it isn´t really one.

I think a future request for the asXml-Method is a good way to discuss if
a change is needed.

Thanks for help.

Andreas


Am Mittwoch, den 21.10.2009, 13:26 +0200 schrieb Ahmed Ashour
<asashour@...>:
> Hi Andreas,
>
> The discussion is getting in two directions:
>
>     - Does HtmlUnit incorrectly behave, and a fix is needed? I don't
think

> this is the case as of now.
>     - Replacing the not-normal space, you can use
> string.replaceAll("\u00A0", " ");
>
> Hope that helps,
>
> Enjoy,
> ----
> Blog: http://asashour.blogspot.com 
>
> ________________________________
> From: Andreas Korzinowski <andreas@...>
> To: htmlunit-user@...
> Sent: Wed, October 21, 2009 1:59:53 PM
> Subject: Re: [Htmlunit-user] Problem to handle " "
>
>
> Thank for your replay,
>
> yes, i mean the & n b s p ; - Tag, but i wrote the mail with a
> webmailer-frontend, and this filters this tag.
>
> When i take the result from anchor.getTextContent() to Std-Output like:
> System.out.println("Link is: " + link.getTextContent());
> then it shows me a normal blank on the place, where in the html-source
are
> the noblankspace-signs. (In the Netbeans Output-Window)
>
> A replaceall doesn´t work, because he tried to replace the
> string-equivalent and not the html-signs.
> Also trim() doesn´t work, because this is not a normal blank.
>
> Exists there a special regex - method to replace the noblankspace-sign
to

> a normal blank for further handling ?
>
> Greetings
> Andreas
>
> Am Mittwoch, den 21.10.2009, 12:31 +0200 schrieb Kumararaja Gunasekaran
> <kumar@...>:
>> Hi,
>>
>> Have you tried to call trim() , replaceAll(" ",""); before doing any
>> string manipulation
>>
>> Thanks,
>> Kumar.
>> From: Ahmed Ashour [mailto:asashour@...]
>> Sent: 21 October 2009 11:27
>> To: htmlunit-user@...
>> Subject: Re: [Htmlunit-user] Problem to handle " "
>>
>> Hi Andreas,
>>
>> And based on what you consider &nsbp; = ' '?
>>
>> The below test case shows that real browsers treats them differently.
>>
>> <html><head><script>
>> function test() {
>> 
>
alert(document.getElementById('mydiv').firstChild.nodeValue.charCodeAt(0));

>> }
>> </script></head><body onload='test()'>
>> <div id='mydiv'> </div>
>> </body></html>
>> Yours,
>> Ahmed
>> ----
>> Blog: http://asashour.blogspot.com
>> ________________________________
>> From: Andreas Korzinowski <andreas@...>
>> To: htmlunit-user@...
>> Sent: Wed, October 21, 2009 12:07:48 PM
>> Subject: [Htmlunit-user] Problem to handle " "
>>
>>
>> Hello,
>>
>> With the anchor.getTextContent() - method i get the text from an link.
>> But sometimes this text contains the noblankspace ( ) sign. This
>> looks
>> like a normal blank, but it isn´t.
>> When i compare strings from the getTextContent-Method with .equals or
> with
>> "==", the answer
>> is false, because the strings are different.
>> Is there anyone who had resolved this problem in a dapper way ?
>>
>> Is there a way to replace the   to a normal blank ?
>>
>> Greetings
>> Andreas
>>
>>
>
------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart
your
>> developing skills, take BlackBerry mobile applications to market and
> stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Htmlunit-user mailing list
>>
>
Htmlunit-user@...<mailto:Htmlunit-user@...>
>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user
>
>
------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and
stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Htmlunit-user mailing list
> Htmlunit-user@...
> https://lists.sourceforge.net/lists/listinfo/htmlunit-user

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user