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

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.
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
and
to the top of the file.
I tried TextField#value= instead of TextField#set.
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.
There is a page about scripting Excell, but it is unavailable at the moment. Fortunately, there is Google cache version.
Permalink
02.23.07
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.

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

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.
Permalink
02.21.07
Posted in Bugs at 10:52 am by Željko Filipin

I started to get a lot of spam comments, and yesterday I installed Askimet. This morning, I found a bug in Askimet. Don’t you just love to start a day with a bug?
This is bug report I sent.
I think I found a bug.
I have WordPress 2.1 and Akismet 2.0.
At “/wp-admin/edit-comments.php?page=akismet-admin” page (Comments > Akismet Spam) I have 51 spam comment, just enough for two pages.
There I can click “2″ or “Next Page »” link that leads me to “wp-admin/edit-comments.php?page=akismet-admin&apage=2″ page.
There are links “« Previous Page” and “1″ that lead to “wp-admin/edit-comments.php?page=akismet-admin&apage=” page (please notice that the number “1″ is missing at the end of the url).
At that page I get this error message:
“WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-50, 0' at line 1]
SELECT * FROM wp_comments WHERE comment_approved = ’spam’ ORDER BY comment_date DESC LIMIT -50, 0″
I guess that is because I am at page “[...]&apage=” and it should be “[...]&apage=1″ (again, the number “1″ is missing at the end of the url).
Links “2″ or “Next Page »” point to “[...]&apage=2″ and links “« Previous Page” and “1″ point to “[...]&apage=” instead of “[...]&apage=1″ (once more, just to be sure, the number “1″ is missing at the end of the url).
Permalink
02.09.07
Posted in Ruby at 12:31 pm by Željko Filipin
Yesterday I wrote about Ruby hashes. Use it and you can write nice looking code.
Instead of ugly code.
I got interested when I saw this at wtr-general
This will find the second div with the name ‘foo’.
I tried to do something like that, but this was the best I could think of.
And, of course, it did not work.
ArgumentError: wrong number of arguments (1 for 2)
I posted my problem to wtr-general and Charley Baker was kind enough to help me. A link to Collecting Hash Arguments (at the bottom of the page) from Programming Ruby said it all.
Permalink
02.08.07
Posted in Ruby at 3:25 pm by Željko Filipin
I have seen Ruby hashes in use, but I never needed them. Until today. I was testing edit community feature. I started with editing title.
I created class Community and method edit.
Then I tested editing other community properties. Sometimes I need to edit just one property, sometimes a few of them and sometimes all properties. The only way I could think of how to do it is to make all arguments of edit method optional.
But that caused ugly code when calling edit method if, for example, I only wanted to change security property.
I could make edit_security (and edit_title, edit_url…).
Better, but I wanted to try hashes, and it worked great.
Permalink
02.07.07
Posted in E-mail at 6:12 pm by Željko Filipin
Lately I have been testing e-mail functionality of web application. This is the fifth post about that experience. Last week I wrote about lessons learned.
I have written a little framework that helps me with testing e-mail.
To use it, you will have to install Ruby, Tmail and SMTP server.
Then download mail.zip (2,20 KB) and extract it. No installation required. There are even some unit tests (unit_tests.rb) and example code (usage.rb).
Send mail.
Check if application sent mail that you have expected.
For now, mail that is sent can only contain from, to, subject and body. While receiving, I only check from, to and subject.
This is code that I am really using every day.
Please understand that I am a tester, not a developer, and I know that this code could be better. Feel free to improve it. Post bug reports and your comments here.
Permalink
02.06.07
Posted in Watir at 2:21 pm by Željko Filipin
There are two links in a page that I am testing.
I need to get value of href attribute for the second link.
I can not use :text, because it will return href attribute for the first link.
I can use :index, but if anything on that page changes, it could break.
Bret Pettichord posted posted a solution for this at wtr-general a few months ago.
In 1.5, this syntax works:
This will find the second div with the name ‘foo’.
Not all elements yet have multiple attribute support.
And it really works.
Permalink
02.01.07
Posted in Watir at 11:35 pm by Željko Filipin
Bret Pettichord posted this at wtr-general few days ago.
If you have a link
you can click it using
Permalink