Re: [Wtr-general] check what's the content of this certain text

2005-09-14 Thread Atilla Ozgur
put textsearch.html to 1-25/25 puts pagecontainstext_test.rb def test_match_regexp_found2 $~ = $ie.contains_text(/\/25/) assert_equal('/25', $&) end def test_match_regexp_found3 $~ = $ie.contains_text(/(\/25)/) assert_equal('/25', $1) end thes

Re: [Wtr-general] check what's the content of this certain text

2005-09-13 Thread Bret Pettichord
At 09:44 AM 9/13/2005, Atilla Ozgur wrote: parantheses gives you what is matched. for example you have something like this. (\d\d)-(\d) if this expression matches to 25-1 $1 gives you 25, $2 gives you 1. Since you have not parantheses in your regular expression, ruby gives you nil. You find that

Re: [Wtr-general] check what's the content of this certain text

2005-09-13 Thread Atilla Ozgur
erprets and computes 1-25/25 > as nil instead? > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bret Pettichord > Sent: Tuesday, September 13, 2005 12:34 PM > To: wtr-general@rubyforge.org > Subject: RE: [Wtr-general] check what'

RE: [Wtr-general] check what's the content of this certain text

2005-09-12 Thread Jan.Montano
September 13, 2005 12:34 PM To: wtr-general@rubyforge.org Subject: RE: [Wtr-general] check what's the content of this certain text At 10:14 PM 9/12/2005, [EMAIL PROTECTED] wrote: >hi I used this... > >if $ie.contains_text("/25") then puts $& end > >but it return

RE: [Wtr-general] check what's the content of this certain text

2005-09-12 Thread Bret Pettichord
At 10:14 PM 9/12/2005, [EMAIL PROTECTED] wrote: hi I used this... if $ie.contains_text("/25") then puts $& end but it returns nil. don't know why. I'm assuming it will return /25 or rather the whole text. You have to use a regular expression: $ie.contains_text(/\/25/); puts $& (You have

RE: [Wtr-general] check what's the content of this certain text

2005-09-12 Thread Jan.Montano
nday, September 12, 2005 11:34 PM To: wtr-general@rubyforge.org Subject: RE: [Wtr-general] check what's the content of this certain text After calling ie.contains_text(), check the value of $& -- it'll be the value that was matched. Bret At 06:45 AM 9/12/2005, [EMAIL PROTECTED] wro

RE: [Wtr-general] check what's the content of this certain text

2005-09-12 Thread Jan.Montano
oh I see. Thanks a lot! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bret Pettichord Sent: Monday, September 12, 2005 11:34 PM To: wtr-general@rubyforge.org Subject: RE: [Wtr-general] check what's the content of this certain text After ca

RE: [Wtr-general] check what's the content of this certain text

2005-09-12 Thread Bret Pettichord
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Atilla Ozgur Sent: Monday, September 12, 2005 7:21 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] check what's the content of this certain text try regular expressions? \d-\d\\\d \d matches digits. assert($ie.contai

RE: [Wtr-general] check what's the content of this certain text

2005-09-12 Thread Jan.Montano
-general] check what's the content of this certain text try regular expressions? \d-\d\\\d \d matches digits. assert($ie.contains_text(/\d-\d\\\d/)) this should match 1-1\1 to 9-9\9 but if you reports will have more than one digit, you should use. \d\d to match two digits. Hope it wi

Re: [Wtr-general] check what's the content of this certain text

2005-09-12 Thread Atilla Ozgur
try regular expressions? \d-\d\\\d \d matches digits. assert($ie.contains_text(/\d-\d\\\d/)) this should match 1-1\1 to 9-9\9 but if you reports will have more than one digit, you should use. \d\d to match two digits. Hope it will be usefull. On 9/12/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]>

[Wtr-general] check what's the content of this certain text

2005-09-11 Thread Jan.Montano
attached is the source of the webpage I want to test. I need to check a certain text in this area. in this example... particularly the "1-1/1" string. and that's dynamic depending on the number of reports returned. It could be 1-3/3, etc... What's the best way in doing this? Thanks. <> -Ja