02.26.07

Enter Non-English Character in Text Field

Posted in Watir at 3:48 pm by Željko Filipin

google_zeljko.PNG

I use Watir a lot. I wanted to set a text field to “željko”. I did not know it would not be an easy task. I tried this code.

ie.text_field(:index, 1).set(”željko”)

But, text field was set to “§eljko”, “Ĺľeljko”, just “eljko” or some other string (depending if I try from irb, or from file that is saved in some encoding).

I searched wtr-general and found different solutions.

I added

require “win32ole”
WIN32OLE.codepage = WIN32OLE::CP_UTF8

and

$KCODE = ‘utf8′
require ‘jcode’

to the top of the file.

I tried TextField#value= instead of TextField#set.

ie.text_field(:index, 1).value=(”željko”)

I saved file as UTF-8.

Nothing worked. I sent my question to wtr-general and Paul Carvalho answered.

[...] I have a Watir script [...] It reads the inputs from an Excel file into an Array and then I use the array data to populate the text fields. [...] I didn’t use any special ‘require’ lines or KCodes. I just let Excel worry about holding the data [...]

I tried it, and it worked! It was simple, too. Just a few lines of code.

require ‘watir’
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
ie = Watir::IE.start(”http://www.google.com/”) # start IE
ie.text_field(:index, 1).set(cell) # set text field to value from cell

There is a page about scripting Excell, but it is unavailable at the moment. Fortunately, there is Google cache version.

02.23.07

Google for “Blog on Software Testing”

Posted in Self Education at 5:33 pm by Željko Filipin

Yesterday I had a Gmail chat with Rosie Sherry. I found her blog because she has a link to my blog. I just wanted to know how she found my blog. She was not sure if she found it on Google or she followed a link from another blog.

But, this is not what I wanted to write about. She surprised me with this sentence.

You come up on the third page of Google for software testing blog.

I had to check it immediately. She was not joking. I also checked my PageRank™. It was 4.

I started playing with different search terms, and if you use google.hr (I am from Croatia) and search for blog on software testing this blog will be ranked 10th! The first page! (On google.com it is 12th.)

I have been changing the title of my blog from Željko Filipin to Željko Filipin’s Blog to Željko Filipin on Software Testing and finally to Željko Filipin’s Blog on Software Testing. I think this title is the best description of this blog. And, it really helped being ranked so high.

google_t.png

02.22.07

Internet Explorer 7 Bug

Posted in Bugs at 9:54 am by Željko Filipin

ie.png

I noticed a minor bug in Internet Explorer 7. Tab is separated from the page (see picture). That extra space disappears when I move focus from Internet Explorer window.

« Previous entries Next Page » Next Page »