I am required to automate a portion of a .NET application to cut down the time spent in smoke testing. I have used Selenium RC successfully on other projects that run on both Internet Explorer and Firefox. I used Selenium IDE for firefox to record user actions and Selenium RC under eclipse to tune my script and add logic, switching and DB Access blocks. And JUnit of course to create test cases.
There's a little problem: the application is a .Net back office application that is always run on Internet Explorer by internal clients. Because of that, the developer haven't ever paid attention to browser compatibility. And as a result, the application runs terribly on Firefox. And it's not possible to use Selenium IDE to record actions and then run the scripts on IE.
Theoritically, it's possible to code all your scripts by hands using Selenium and run them on IE with Selenium RC, but who has time to do that?
I've heard about Watir before, but never used it. Now i am experimenting with it and i like what i see. Watir Recorder will seamlessly save your time in recording user actions. Here's how a recorded ruby script will look like using Watir Recorder (click to enlarge):
Or you may prefer the text version:
require 'watir'
include Watir
require 'test/unit'
class TC_recorded < Test::Unit::TestCase
def test_recorded
ie = IE.new
ie.goto('http://www.google.com/webhp?sourceid=navclient&ie=UTF-8')
ie.link(:url, 'http://www.google.com/advanced_search?hl=en').click
ie.text_field(:name, 'as_q').set('testsquad test automation blog')
ie.select_list(:name, 'num').select_value('10')
ie.select_list(:name, 'num').select_value('20')
ie.select_list(:name, 'lr').select_value('lang_en')
ie.button(:value, 'Advanced Search').click
end
end
Up from this point you can copy your base script to a ruby (*.rb) file and add whatever logic, switching and DB access blocks to extend and parametrize your test. Today, Watir Recorder has been able to recognize text boxes, buttons, links and combo boxes for non .Net applications. As i said, i am still experimenting and i will post more results in the coming days.
Please share your experience! :)
Updates: Google Test Automation Conference is coming. Check the details on Google Testing Blog
Like Concern Suggest Six Sigma Tool
0 comments Published by adel shehadeh on Saturday, April 19, 2008 at 11:30 PMFrom now on, i will be frequently discussing some of the cool Six Sigma tools that i have learned back in 2004 in an amazing 2-day extensive Six Sigma course. Today's tool is called Like-Concern-Suggest or LCS Tool for short. It's very simple and this is how it works:
You morning started your day with an early meeting with your boss or co-worker to discuss a certain technicality in a project. Your boss throws an idea that you think will have some limitations when applied into the ground. You boss maybe unaware of it. There are tow drastically different approaches to present your point of view:
- You interrupt your boss and say "I have to disagree with you because this will not work since our platform is based on bla bla bla". This is such a negative way of presenting your idea. And it will leave a bad impact on the listener. He/she will forget all of what you have just said and start thinking about how awful you have been.
- You try to find the bright side of your boss's idea. Try to see where it's applicable and mentally emphasize on that. Then try to see where it fails and scrutinize it. This is all done mentally and in a blink of an eye. Finally, formulate your sentence using the magical LCS Tool as follows:
I like the idea since it collates with our business need ... etc, My concern is that when we implement it ..., it will fail because of ... etc. I suggest we use the X method since it's more applicable on .... etc.
These kind of tools may seem straightforward, but sometimes you need someone to tell you about them. :)
Why does Agile Software Development pay
0 comments Published by adel shehadeh on Tuesday, April 15, 2008 at 10:45 PMI really like it when concepts are proved mathematically:
benefits of agile
Developers Compliance to Test Automation
1 comments Published by adel shehadeh on Friday, April 11, 2008 at 8:22 PMA TestSquad reader sent me an email asking:
Is there a verification process to help validate that application developers comply to test automation requirements during their application development?
Usually we just give the requirements and expect application developers to comply but when you are doing the automation scripts already, some things are still skipped. I am looking for a process that will help them comply.
e.g. automation requirement: name tables as xxxx
I have to admit that answering such a question is not easy. How can you guarantee that development activity is compliant with a subsequent test automation? How does the developer's code affect the success of your test automation?
1 month ago, i was considering Selenium RC to automate a Java web application. Unfortunately and for a reason, automation was not introduced till a late stage in the project. So as soon as we started recording scripts, a problem emerged: the development team did not give an "id" attribute to the numerous html elements. And this forced us to use some workaround; unnecessary if if the QA automation effort was introduced from day one. This is relatively a simple scenario that could be solved using workaround, but i am sure the impact can much more severe for complex projects.
So a corollary answer for the original question is "continuous collaboration between developers and testers from day one in the SDLC" and that naturally leads us to Agility.
I like to use LinkedIn for tough questions. Here's the best answer i got from Greg Akins
I don't think there is an easy answer to this. One issue is
that there is a responsibility for the developer to not only create
features which are requested by the customer/business, but also to
ensure that the features are are created in a way that supports the
test process. It's my experience that the incentive to do the latter
is somewhat limited.
However, having spent time writing and designing Selenium and FIT
tests on smallish team, there was a long learning period associated
with getting the team to understand how the application needed to be
designed to support testing. I'd definitely suggest working side by
side with your developers, and iterating frequently while you're still
expecting frequent "failures" in the dev/test process
I would love to her your personal experience :)






