Test Automation

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.

Watir-Webdriver: Website certificate does not come from a trusted source

A colleague came across this problem while executing our acceptance tests. The issue was related to the fact that the SSL certificate for the site was named differently from the domain on which the test were being executed on . Hence, we got this error: “xxx.xxx.xxxx uses an invalid security certificate.The certificate does not come from a trusted source.The certificate is only valid for <a id=“cert_domain_link” title=“xxx.xxx.com”>xxxx.xxxxx.com</a>The certificate will not be valid until 13-Jul-11 10:28 AM.

Writing acceptance test before development or implementation starts

In my the few years, where i have pushed for testers developers to write acceptance test before development or implementation commences, I’ve had testers come up to me say its difficult to achieve this when you dont know what the UI would look like. This post would attempt to decribe how i have done this in the past and i still do this at the moment. NB: Ideally i would write my test using page object pattern, if this was a new project, I would start creating page objects

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.

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.

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.

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.

Workaround: Flash selenium test would not run in firefox 3.5 except when the browser mode is *firefoxProxy

I looked into flash selenium a few weeks back and i thought it was a great way for me to test certain part of the apps i have been ignoring for some time. However after knocking up a few test i discovered that my test would not run in my version of firefox (3.5). I got this error: INFO - Got result: ERROR: Threw an exception: NPMethod called on non-NPObject wrapped JSObject!