[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...
For anyone interested, I did get this to work after all - I needed to add these two lines to my spec_helper.rb (or whatever setup file you may be using): $KCODE = "u" WIN32OLE.codepage = WIN32OLE::CP_UTF8 Firefox then works with Japanese, German, etc - though some things are a bit more limited than IE still. For example, you can do this in IE: @browser.button(:value, "続行").click But this won't work with non-English characters in FF... But unicode strings in most other places do work, e.g.: @browser.button(:id, "continue").value.should == "続行" will pass... Selecting items from lists, etc is also working correctly BTW, what is happening with previous messages on Google groups? All my previous messages on this thread are now blank... Regards, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...
Bret, I suspected the JSSH plugin might be to blame but don't know anything about its' internal workings. Does anyone know if it is possible to get it to accept UTF-8 encoding? Is anyone here able to work with unicode input in Firefox? Michael, the problems are with two byte Japanese characters but also with any special characters in western languages that require unicode support, such as accented characters - e.g. the "ä" in the German string "Männlich". With Japanese, I can't work with the system at all, as the HTML for most elements will look like this: 回答を選択してください 男性 女性 Now in the above example, you could argue that I could always use the value number, like so: @browser.select_list(:id, /[\w\d_-]+GENDER/).select_value("1") And yes, this would work, but I need to be able to use the visible text as well, like: @browser.select_list(:id, /[\w\d_-]+GENDER/).select(/男性/) And this only works in IE for me... Even if I adapt my scripts to use the number values in select lists, I still have no way to input Japanese characters into text fields or do assertions on Japanese text read from labels and other elements. I would imagine there's a way to get FireWatir to fully work with pages containing unicode elements but I am stumped as to how to do so? Regards, John --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...
Is it for Japanese chars(two bytes) or Western chars? Do you have sample html codes that we can take a look? - Original Message From: John Kolokotronis To: Watir General Sent: Thursday, February 19, 2009 7:42:46 AM Subject: [wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE... Furthermore, I tried Željko's solution here: http://zeljkofilipin.com/2007/02/26/enter-non-english-character-in-text-field/ Works perfectly with Watir/IE - I adapted the example for FireWatir: require 'watir' require 'win32ole' Watir::Browser.default = 'firefox' excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open("C:/data.xls") # open file worksheet = workbook.Worksheets(1) # the first worksheet cell = worksheet.Range('a1')['Value'] # value of single cell @browser = Watir::Browser.start("http://www.google.com/";) @browser .text_field(:index, 1).set(cell) # set text field to value from cell And the "Männlich" string becomes garbage: "Mà¤nnlich" Not sure what else to try... FF itself is set to UTF-8 page encoding and displays all unicode fine - it's only values manipulated/input by my scripts that are being messed up... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...
My guess is that the problem lies with the encoding used over the socket that connects to the JSSH plugin. Bret John Kolokotronis wrote: > Furthermore, I tried Željko's solution here: > > http://zeljkofilipin.com/2007/02/26/enter-non-english-character-in-text-field/ > > Works perfectly with Watir/IE - I adapted the example for FireWatir: > > require 'watir' > require 'win32ole' > > Watir::Browser.default = 'firefox' > > excel = WIN32OLE::new('excel.Application') > workbook = excel.Workbooks.Open("C:/data.xls") # open file > worksheet = workbook.Worksheets(1) # the first worksheet > cell = worksheet.Range('a1')['Value'] # value of single cell > > @browser = Watir::Browser.start("http://www.google.com/";) > @browser .text_field(:index, 1).set(cell) # set text field to value > from cell > > And the "Männlich" string becomes garbage: > "Mà> ¤nnlich" > > Not sure what else to try... FF itself is set to UTF-8 page encoding > and displays all unicode fine - it's only values manipulated/input by > my scripts that are being messed up... > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: FireWatir and unicode IDs/input, etc... Works with Watir/IE...
Furthermore, I tried Željko's solution here: http://zeljkofilipin.com/2007/02/26/enter-non-english-character-in-text-field/ Works perfectly with Watir/IE - I adapted the example for FireWatir: require 'watir' require 'win32ole' Watir::Browser.default = 'firefox' excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open("C:/data.xls") # open file worksheet = workbook.Worksheets(1) # the first worksheet cell = worksheet.Range('a1')['Value'] # value of single cell @browser = Watir::Browser.start("http://www.google.com/";) @browser .text_field(:index, 1).set(cell) # set text field to value from cell And the "Männlich" string becomes garbage: "Mà¤nnlich" Not sure what else to try... FF itself is set to UTF-8 page encoding and displays all unicode fine - it's only values manipulated/input by my scripts that are being messed up... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---