开发者

Non-latin letters in test script result in "No translation for key. Assuming unicode input..."

When I execute on Windows7+Ruby1.9.2+watir-webdriver this test script:

# encoding: utf-8
require "rubygems"
require "watir-webdriver"
ie = Watir::Browser.new :ie
ie.goto "www.tilde.eu"
ie.select_list(:name => "tr-direction").select "Latvian-English"
ie.select_list(:name => "tr-direction").selected? "Latvian-English"
ie.text_field(:class => "tr-area").set "skolas dārzā aug divas priedes"
ie.element_by_xpath("/html/body/div[3]/div/div/div/section/div/div/div/form/table/tbody/tr/td[3]/input").click
Watir::Wait.until { ie.text.include? "About Tilde Machine Translation" }
puts ie.div(:class => "translate_text_result").text

Script executes fine as it is in Firefox, but IE9 crashes when trying to set "ā" letter in text field and CMD shows following:

No translation for key. Assuming unicode input: 257
Timeout awaiting keypress: 82
Key up failed: 1400
Key down failed: 1400
Timeout awaiting keypress: 90
Key up failed: 1400
No translation for key. Assuming unicode input: 257
Key down failed: 1400

Script executes completely in Chrome, but still some warning in CMD are shown:

Started ChromeDriver
port=52409
version=14.0.836.0
[0825/095000:WARNING:webdriver_key_converter.cc(271)] No translation for key code. Code point: 257
[0825/095000:WARNING开发者_如何学C:webdriver_key_converter.cc(271)] No translation for key code. Code point: 257

Do I need to specify anything else apart from # encoding: utf-8 for it to work correctly in IE and Chrome?

I suggest to excecute above script on your computer to determine if this is common issue or just something in my configuration.


This is a known bug in the IE driver, which you can follow here. The warnings in Chrome are harmless, though they probably shouldn't be printed by default.


I've discovered that issue is actual only if non-windows keyboard layout is set. If any of standard windows layouts is set e.g. "Latvian(QWERTY)" on script execution machine, IE doesn't crash anymore just outputs warnings similar to Chrome.

Temporary hack until IE driver bug is fixed could be to set standard windows keyboard layout before execution of test suite and to revert to previous one after execution.

How to get the keyboard layout on windows with ruby? - for inspiration.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜