On Tue, Feb 18, 2014 at 11:43 AM, Michael Zawoysky <lists / ruby-forum.com> wrote:

> I am using the IE-8 browser for my environment.

By "environment" I meant what OS, what version/patch level of Ruby,
versions of gems, etc.

> When I perform the test using the irb function, I do not get an error,
> because the aspostrophie is automatically remove during entry.

That makes no sense to me.

> if/else test provides a nil (false)which makes the test fail.

I'm also not sure what that means.

> I tried your idea's , but received an error.  I entered as follows:
> #1
> require 'watir'
> browser = Watir::Browser.new
> browser.maximize
> browser.goto("http://example.com/")- replace with my site
> string = "Michael's"
>> puts "#{browser.text.encoding} #{string.encoding}"

I hope you didn't really have a '>' character at the start of the
line of that `puts` ...

> if browser.text.include? ("Michael's")
>   puts "pass"
> else
>   puts "fails"
> end
> Result:  Received a syntax error

You will be much more likely to get useful help if you paste in the
ACTUAL ERROR MESSAGE with any accompanying stack trace
rather than meaningless noise like "received a syntax error".

> #2
> require 'watir'
> string.force_encoding("UTF-8")

Of course that won't work -- "string" is undefined there. In my prior
example it is a variable with the value "Michael's".

-- 
Hassan Schroeder ------------------------ hassan.schroeder / gmail.com
http://about.me/hassanschroeder
twitter: @hassan