When I was automating testing our first project, it was a web based administration app. For that, I did some research and we chose to go with Sahi. I was able to achieve about 60-70% automation with Sahi and very happy with its result. During that time, one day I also gave a presentation at my office about what and how is web testing automation with Sahi. The presentation I created for this is the following:
This presentation gives a very brief idea about web testing automation in general and with Sahi. In the coming posts, I will try to share the issues I faced both with automating testing for desktop and web apps.
Recently we purchased TestComplete license. After some initial phase of learning the tool, I have now started automating our actual test cases using TestComplete. Before going to start this I did the following:
- Studied Software Test Automation book by Mark Fewster & Dorothy Graham (highly recommended for those who are starting automating tests)
- Studied and watched different webinars on Automated QA’s website.
Overall, it is going smooth and good. But obviously, it is taking sometime to get used to this. In some of my next posts, I will share how I am doing with this.
So for now we are using TestComplete for desktop and Sahi for web app testing automation.
I have been developing in PHP from the last 4-5 years. Since the introduction of OOP concepts in PHP5, the language is getting matured and more ready for large applications.
While working with large projects, one can not avoid logging for error / debug to later diagnose the issues one might face in production. So beside logging some general information and simple errors which PHP throws and we could get from PHP we could also capture the whole backtrace for the code we are running in such case.
It could be easily incorporated in your application. Follow are some modified examples from PHP’s documentation debug_print_backtrace:
//This is backtrace_include.php
//This function modifies the output which PHP provides for debug_print_backtrace
//by dany dot dylan at gmail dot com
$trace = ob_get_contents();
// Remove first item from backtrace as it's this function which
// is redundant.
$trace = preg_replace ('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $trace, 1);
// Renumber backtrace items.
$trace = preg_replace ('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace);
$trace = a();
Save the above file as backtrace_include.php and call in the following file:
//This is backtrace_test.php
This will print the following:
#0 c() called at [/home/www/backtrace_include.php:29]
#1 b() called at [/home/www/backtrace_include.php:24]
#2 a() called at [/home/www/backtrace_include.php:37]
#3 include(/home/www/backtrace_include.php) called at [/home/www/backtrace_test.php:3]
Usually in production websites, we don’t print such trace on screen and log this in a file. We will also log such information only in a situation when an error occurs while executing the code.
Sahi helped us automate our web application testing by 60%-70%. Till now I am quite happy with it.
For our testing automation and testing environment, some time ago I did some research on the available tools and also evaluated some of them.
I thought, that the tools of list I found during the research (though I didn’t try all of them) would be worth sharing with readers:
I will try to add a small description for each of the testing tool in the above list.
On a continuation to my previous post regarding Testing Automation Tools, I will try to write the process through which I went while writing the testing scripts.
The application for which I wanted to do the automated testing is a web based application written in PHP on top of Zend Framework. As Zend Framework follows the MVC pattern, we followed the same pattern. For database, we wrote our own layer and didn’t use the layer which Zend Framework provided.
For testing automation I followed the same design rules, which I followed while designing and writing this application. I wrote testing scripts for each entity in their own files. Then I called them in one main file, which I run when I want to run the regression test. Following is an example configuration file:
//include all files, which are required to run the test cases
// create company info
I treat this main script as my main configuration file. Where I declare some global variables, call those scripts which I need to run during my test run. I can include the scripts, which I need to run and can exclude those scripts which I don’t need.
I will continue with this series with further updates on how I wrote automated tests for every individual entity.
I recently started using Sahi. Sahi is an automation and testing tool for web applications, with the facility to record and playback scripts.
When I was trying to find any tool for testing automation, I evaluated many tools as the following:
- AutomatedQA’s TestComplete – It is one of the other product which I would love to use. It is an excellent product and could be used very nicely for GUI applications. I had to drop this from the list due to its price 🙁 and availability of free / open source automation tools for web.
- Watir – I couldn’t try this much but it was dropped from the list due to the learning curve involved in learning Ruby and then using this whole suite efficiently. Though, it seems to be a nice product and offers many add-ons.
In the next posts, I will try to post some more details about my testing experience.