Re: [wtr-general] Watir Issue with Japanese characters
Yay!! I have a found a way to make this work. Instead of using the text_field's set method directly setting the value to the text_field is working without any issues. Please find the working code which was able to enter japanese characters in a textbox. I saved the ruby script using the notepad++ editor in the UTF-8 without BOM encoding. Hope this helps other Watir users stuck like me. require 'paths.rb' require 'win32ole' require 'watir' WIN32OLE.codepage = WIN32OLE::CP_UTF8 #UTF-8 ### $Browser = nil ENV[watir_browser]=ie $Browser = Watir::IE.start(www.google.com) $Browser.text_field(:name,'q').value = 管理者 ### On Monday, November 26, 2012 11:45:19 AM UTC+5:30, Ashok Prabhu wrote: Hi Zeljko, I tried to read the japanese characters from an excel sheet. However it does not seem to work. It showing up boxed characters still in internet explorer text_field. Thanks, ~Ashok. On Friday, November 23, 2012 9:27:04 PM UTC+5:30, Željko Filipin wrote: On Fri, Nov 23, 2012 at 4:18 PM, Ashok Prabhu ashokp...@gmail.com wrote: m using ruby 1.8.6 and watir 1.5.1.1230 for my testing. I m trying to enter some japanese characters into the internet explorer textbox using watir. However I getting a series of boxed characters instead. Maybe one of these old posts could help you since you are using pretty old versions of both Ruby and Watir: http://zeljkofilipin.com/enter-non-english-character-in-text-field/ http://zeljkofilipin.com/utf-8-and-ruby/ Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Issue with Japanese characters
On Mon, Nov 26, 2012 at 10:05 AM, Ashok Prabhu ashokprab...@gmail.com wrote: I have a found a way to make this work. Thanks for letting us know. I have noticed similar questions from time to time. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Issue with Japanese characters
Hi Zeljko, I tried to read the japanese characters from an excel sheet. However it does not seem to work. It showing up boxed characters still in internet explorer text_field. Thanks, ~Ashok. On Friday, November 23, 2012 9:27:04 PM UTC+5:30, Željko Filipin wrote: On Fri, Nov 23, 2012 at 4:18 PM, Ashok Prabhu ashokp...@gmail.comjavascript: wrote: m using ruby 1.8.6 and watir 1.5.1.1230 for my testing. I m trying to enter some japanese characters into the internet explorer textbox using watir. However I getting a series of boxed characters instead. Maybe one of these old posts could help you since you are using pretty old versions of both Ruby and Watir: http://zeljkofilipin.com/enter-non-english-character-in-text-field/ http://zeljkofilipin.com/utf-8-and-ruby/ Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Watir Issue with Japanese characters
m using ruby 1.8.6 and watir 1.5.1.1230 for my testing. I m trying to enter some japanese characters into the internet explorer textbox using watir. However I getting a series of boxed characters instead. I tried writing the japanese characters into a file using ruby and it works fine. Please find below the snip which explains the problem. Please help me resolve this problem. I m stuck with this for the past two days. require'paths.rb' require'watir' require win32ole WIN32OLE.codepage = WIN32OLE::CP_UTF8 $KCODE = 'utf8' require 'jcode' strProxyAddress = '管理者' puts strProxyAddress open(C:\\test.txt,w).write(strProxyAddress) i=Watir::IE.attach(:title,/google/i) i.text_field(:index,2).set(strProxyAddress) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Issue with Japanese characters
On Fri, Nov 23, 2012 at 4:18 PM, Ashok Prabhu ashokprab...@gmail.com wrote: m using ruby 1.8.6 and watir 1.5.1.1230 Where did you get that version? It is not on the list here: https://rubygems.org/gems/watir/versions Željko -- https://leanpub.com/watirbook -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Issue with Japanese characters
On Fri, Nov 23, 2012 at 4:18 PM, Ashok Prabhu ashokprab...@gmail.com wrote: m using ruby 1.8.6 and watir 1.5.1.1230 for my testing. I m trying to enter some japanese characters into the internet explorer textbox using watir. However I getting a series of boxed characters instead. Maybe one of these old posts could help you since you are using pretty old versions of both Ruby and Watir: http://zeljkofilipin.com/enter-non-english-character-in-text-field/ http://zeljkofilipin.com/utf-8-and-ruby/ Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com