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 ö for example). Example of a button name "Wähle 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/el
ement.rb:66:in `assert_exists': Unable to locate element, using
{:tag_name=>["button", "submit", "image", "reset"], :value=>"W\xE4hle 6
Zufallszahlen"} (Watir::Exception::UnknownObjectException)
---- Begin script extract
···
-------------------------------------------------------------------
#encoding: ISO-8859-1
require 'watir'
browser = Watir::Browser.start "http://gahq.hopto.org/lotto/lotto.php"
browser.button(:value,"Wähle 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ähle 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