Each day presents something new to learn.

Apart from Technical Topics, increasingly i find myself wanting to write about other topics that interests me - Entreprenuership and Business, Leadership, Africa, Service Industry (e.g Hotels, Restaurant). My writings would always represent my opinions and it might change from time to time.

Test automation click might not completely simulate an actual human click

I have been working at this client where i am opportuned to use cucumber, watir-webdriver and i came across this problem today. The application i am testing is an e-commerce site and i am writing test for a page on which i click on an item and the item appears on the shopping basket area of the site. My code look like [code] def select_item(item_name) @browser.li(:text => /#{item_name}/).link(:class_name => “addOptions”).click Watir::Wait.

Redirecting blogger post to wordpress.com

I moved my blog from the blogger one to wordpress and i wanted to ensure that people that have bookmarked post on my old blog get redirected to the new one on wordpress as i wouldnt be update the old blog anymore. I found a lot of effort by different people and all the stuff that was suggested using javascript didnt work for me, what i got was regardless of the page you are on my old blogger site, you would be redirected to my homepage on the wordpress site which is not very helpful.

Could not start Selenium session due to browser url not including http

I was helping a friend out last weekend, and he was getting an error java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Error while launching browser at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) This was strange because looking at his code everything seem to be properly set up, i did some debugging and I discovered that the session in the selenium object was null, this suggested that we weren’t initializing the selenium object properly.

could not start Selenium session: Failed to start new browser sesion

I have heard people have problems with starting firefox3 while using selenium1.0.x on windows7. The exact error message is similar to this: java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found in the path! Please add the directory containing “firefox.exe” to your PATH environment variable, or explicitly specify a path to Firefox 3 like this: *firefox3c:\blah\firefox.exe at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89) I attempted to fix this by putting the path in the environment variable of the windows7 machine and it still did not work.

My notes from the selenium conference 2011

I had the opportunity to attend the selenium conference and loads of good stuff, i must tell you. This post is an attempt to highlight the conference talks/ seminar that i really enjoyed. Page Object 101: This was a workshop delivered by Patrick Wilson Welsh and Adam Goucher. Even though I have done a lot of page objects in the past, at a glance i like the way patrick has approached html elements, (wraping each html elements in a class), it feels like writing selenium code in a watir way.

Rails3 'link_to' displays literal HTML on front end

>In the last month, I have been working on a rails3 app and I ran across this interesting problem where I need to create a href link to a another page from my current page. In my view i have written <%= “Please click on this link #{link_to(‘here’, new_house_path)}” %> And interestingly this is displayed as Please click on this link <a href=“http://localhost:3000/houses/new">here</a> on the front end. Hours of frustration and google searches leads me to doing this: <%= (“Please click on this link #{link_to(‘here’, new_house_path)}“).

A tester's reflection on kanban plus BDD

Having just finished an engagement with a client where the development practices include kanban and BDD. Kanban for us meant that we give priority to work on the right side of the board. So as a tester, I would rather spend my time doing some manual testing on a story that is in the QA queue, than writing automated acceptance tests for a story in the queue for Acceptance Tests.

Watir: Search for elements on page using multiple attributes

I ran into a situation today where i wanted to scan through a page and return a table based on the table matching 3 attributes Before: browser.tables.find do |table| table.class_name == ‘my_class_name’ and table.cell(:class, ‘class_1_name’).text == ‘some_text_1’ and table.cell(:class, ‘class_2_name’).text == ‘some_text_2’ end This was taking about 3minutes as there were about 86tables on this page under test. I was worried but the tables on this page was gonna increase with time which meant the time for this stage of the test was bound to increase.

Implement 'Select column_name from table_name where condition' in Active Record

I needed an array from the data contained in a particular database column based on a condition, so i get the array of active record rows: array_of_rows = TableName.find(:all, :conditions => {:column_name => [‘col_data1’,‘col_data2’]}) Then use the array map! function to replace the active record objects with the column_name value array_of_rows.map!{|item| item.column_name} Doing some search got me: array_of_rows = TableName .find(:all,:select=>‘column_name’ :conditions => {:column_name => [‘col_data1’,‘col_data2’]}).map(&:column_name) And i like this better, concise ….

Active Record find by Column Name

In recent days been doing a lot of ruby, which means i tend to use Active Record as well. I had written some scripts where i was selecting records that matched a criteria such as: @table1.table2s.select{|e| e.column_name == 1234} but as i need to sort my result and also give some more conditions to filter the data, i need alternatives to this above query and i ended up with the two lines of code below: