[英]watir-webdriver-0.6.4 text_field cannot set japanese characters
I have been using watir-webdriver-0.6.4 and chrome browser to test my webpages. 我一直在使用watir-webdriver-0.6.4和chrome浏览器来测试我的网页。
Below is my code slice 下面是我的代码片段
@admin_browser.text_field(:name, "member[name]").set "そん"
It works fine if I replace "そん" with English characters, but with this code it behaves like this: 如果我将“そん”替换为英文字符,则效果很好,但是使用此代码,其行为如下:
As you can see it changes into "]". 如您所见,它变为“]”。
I ever searched in Japanese Google and they said I should use .value = "そん"
instead of .set "そん"
. 我曾经在日语Google中进行过搜索,他们说我应该使用
.value = "そん"
而不是.set "そん"
。 But sadly this still doesn't work. 但是可悲的是,这仍然行不通。
PS The ruby version is ruby 1.9.3p429. PS红宝石版本是红宝石1.9.3p429。
gem update watir-webdriver
said nothing to update, so I believe watir-webdriver is the latest. gem update watir-webdriver
说什么也没更新,所以我相信watir-webdriver是最新的。 I just downloaded the latest webdriver from here . 我刚刚从这里下载了最新的webdriver。 My os is windows7 32bits.
我的操作系统是Windows7 32位。
PS again: PS再次:
I just tested it on firefox and it works perfectly. 我刚刚在firefox上进行了测试,效果很好。 Besides, I remember this code ever worked fine on chrome about a week ago and until just now I didn't update my ruby, watir-webdriver or chromedriver.
此外,我记得大约一周前这段代码在chrome上运行良好,直到现在我还没有更新ruby,watir-webdriver或chromedriver。 So maybe the cause is the update of my chrome browser?
那么,可能是因为我的Chrome浏览器更新了吗? I'll download an earlier version of chrome and try again.
我将下载chrome的早期版本,然后重试。
Problem solved, a matter of Chrome version. 问题已解决,仅适用于Chrome版本。 I installed Chrome 29.0.1547.62 and all works fine.
我安装了Chrome 29.0.1547.62,并且一切正常。 I guess this is a bug of latest chrome or the interface has been changed and the chromedriver developer is not noticed
我猜这是最新chrome的错误,或者界面已更改,因此未注意到chromedriver开发人员
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.