From: a.schubert@... Date: 2012-07-16T02:28:05+09:00 Subject: watir browser.button umlaut problem This is a multipart message in MIME format. ------=_NextPart_000_0013_01CD62BF.F2079070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all =20 I am automating some simple Web application testing using watir, i e clicking on browser buttons, selecting an item from a dropdown list etc. Everything I got working except the following. The script should click on browser buttons that contain Umlaut = characters in its name (German =F6 for example). Example of a button name "W=E4hle 6 Zufallszahlen" =20 Problem: The script exists with the following error =20 C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic= /el ement.rb:66:in `assert_exists': Unable to locate element, using {:tag_name=3D>["button", "submit", "image", "reset"], = :value=3D>"W\xE4hle 6 Zufallszahlen"} (Watir::Exception::UnknownObjectException) =20 ---- Begin script extract ------------------------------------------------------------------- #encoding: ISO-8859-1 require 'watir' =20 browser =3D Watir::Browser.start "http://gahq.hopto.org/lotto/lotto.php" =20 browser.button(:value,"W=E4hle 6 Zufallszahlen").click ----End script extract -------------------------------------------------------------------- =20 I thought the #encoding ISO-8859-1 ... at the beginning could help. = Without this line (or encoding set to UTF-8 etc) the script would exit with the error ruby-lotto4b.rb:18: invalid multibyte char (US-ASCII) ruby-lotto4b.rb:18: syntax error, unexpected tIDENTIFIER, expecting ')' browser.button(:value,"W=E4hle 6 Zufallszahlen").click =20 I searched the forum archive, but couldn't spot any information how-to resolve the problem. =20 Has someone encountered the problem as well and found a solution? I am using Ruby 1.9.3-p194 on Win7, browser IE9 =20 Regards Alex Schubert =20 ------=_NextPart_000_0013_01CD62BF.F2079070 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi = all

 

I am automating some simple Web application testing = using watir, i e clicking on browser buttons, selecting an item from a = dropdown list etc. Everything I got working except the = following.

The script should click on = browser buttons that contain Umlaut characters in its name (German =F6 = for example). Example of a button name "W=E4hle 6 = Zufallszahlen"

 

Problem: The = script exists with the following error   

C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0= /lib/watir-classic/element.rb:66:in `assert_exists': Unable to locate = element, using {:tag_name=3D>["button", "submit", = "image", "reset"], :value=3D>"W\xE4hle 6 = Zufallszahlen"} = (Watir::Exception::UnknownObjectException)

 

---- Begin = script extract = -------------------------------------------------------------------<= /o:p>

#encoding: ISO-8859-1

require 'watir'

 

browser =3D = Watir::Browser.start "http://gahq.hopto.org/lott= o/lotto.php"

 

  = browser.button(:value,"W=E4hle 6 = Zufallszahlen").click

----End script extract = --------------------------------------------------------------------=

 

I thought the #encoding ISO-8859-1 ... at the = beginning could help. Without this line (or encoding set to UTF-8 etc) = the script would exit with the error

ruby-lotto4b.rb:18: invalid multibyte char = (US-ASCII)

ruby-lotto4b.rb:18: syntax = error, unexpected tIDENTIFIER, expecting ')' = browser.button(:value,"W=E4hle 6 = Zufallszahlen").click

 

I searched = the forum archive, but couldn't spot any information how-to resolve the = problem.

 

Has someone encountered the problem as well and found = a solution?

I am using Ruby = 1.9.3-p194  on Win7, browser IE9

 

Regards

Alex Schubert

 

------=_NextPart_000_0013_01CD62BF.F2079070--