try ie.text.scan(regexp)

if ie.text.scan(/foo/).length > 0
  ...write some data...
end

btw, this isn't a watir issue, it's a ruby issue. IE#text just returns a string 
and a string's include? method doesn't accept a regex as an argument, at least 
my installed ruby version doesn't support it.

--- On Wed, 12/2/09, mohe <[email protected]> wrote:

> From: mohe <[email protected]>
> Subject: [wtr-general] regular expression in $ie.text.include? issue
> To: "Watir General" <[email protected]>
> Date: Wednesday, December 2, 2009, 12:22 PM
> 
> regular expression is not working in $ie.text.include?.i am
> getting
> error message "`include?': can't convert Regexp into
> String
> (TypeError)" for the following code.any idea please.?
> 
> 
> def verify_field(check,result)
>   if $ie.text.include?(Regexp.new(check))
>     $dt.WriteData("#{result}","Sheet1", "Pass")
>   else
>     $dt.WriteData("#{result}","Sheet1", "Fail")
>   end
> end
> 
> -- 
> You received this message because you are subscribed to the
> Google Groups "Watir General" group.
> To post to this group, send email to [email protected]
> Before posting, please read the following guidelines: 
> http://wiki.openqa.org/display/WTR/Support
> To unsubscribe from this group, send email to 
> [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/watir-general
> 


      

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to