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.

Could not start selenium browser session because browserurl does not include "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:

Fixing the annoying XP Antivirus 2009 OR 2010

This is not a post directly related to my blog but i am sure there are few people out there that might be facing same issues. In the last one week i had friends whose windows machines have been infected the XP Antivirus 2010, which seems to be a clone of XP Antivirus 2009. The symptoms include that you are get annoyings popups asking you to pay for an antivirus, i hope you have exposed yourself already.

Blank cells in step tables in cucumber 0.3.11 is represented as nil

In my current job, I have been doing a lot of acceptance test using Cucumber, Watir and RSpec, obvious all in Ruby. I have been using Cucumber 0.6.x, in which blank cells in the step table are represented by empty string (“”). This was okay for me until today when i had to use a previous version of Cucumber 0.3.11 due to reasons including compatibility with other projects in the CI build.