Here's a quick way to get the character set from the meta tags:
ie = IE.start('http://www.yahoo.com')
meta = ie.document.getElementsByTagName( 'meta' ).item(0)
content = meta.getAttribute('content')
content.strip!
content =~ /[\w+\/]\s*;\s*([\w=\-\s]+)$/
charset = $1.split('=')
assert_equal('ISO-8859-1', charset[1]) # Fails, yahoo is
charset UTF-8
or whatever your character set is. The regular expression might need
to be tweaked but that's the general idea.
-Charley
On 9/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was wondering if there is any way of verifying specific codepage usage
> of a web application (i.e. ISO-8859 instead of UTF-8) using Watir?
>
> Ulrike
>
>
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general