Tuesday, 1 May 2012

UI Automation

One of the tools that I have developed for a client was a prototype GUI automation tool. The tool was required to launch a Windows application on the local computer and interact with it. I used VB.NET and the windows API (FindWindow and ShowWindow) to interact with the tool.

The tool was able to launch the application, find the application on the Windows desktop and then interact with it in a predictable way. So the prototype was successful in that respect. The scope, however, for the automation tool is quite limited in that the interactions must be very carefully scripted to avoid interruption and failure.

Selenium HQ is a good alternative to a completely hand crafted GUI automation tool. Particularly when the Selenium script is written using the Selenium .NET drivers. This combines the ability to drive the GUI offered by Selenium with the ability to provide programmatic data for the automation from C#. In this way, the automation process can be enhanced to perform a much broader set of activities, rather than just simple record and play scenarios.

Saturday, 31 December 2011

Static Map Image Downloader

One of the tools that I have developed for a client is an application that requests an image from Google Maps. The goal was to have an image of the site where work was to be conducted, attached to the site file. When the client created a new set of files for a worksite, the map image would be automatically created by executing this tool with the address information of the worksite.

The client wanted to be able to set the image size and zoom level of the map and then save the resulting image as a static file so that they had a view of the site at the commencement of work (or at least, as at the date of the last update to the Google map data prior to commencement of work).

Using VB.NET I was able to create a small command line tool that the client could execute on demand with the address, image scale and zoom level passed as command line parameters that would request the map image from Google Maps and then save the resulting image data to the clients computer, all in one simple operation.

Thursday, 1 December 2011

Test System XML Generation

I was working for a client where I was engaged in performing testing of a range of integrated systems. The systems passed information between applications via XML files. We needed a method of generating XML messages that were close simulations of production data.

The best way to do this was to develop an application that would harvest data from a test system (populated with a copy of production data) and then generate the XML message files that would simulate the various types of transactions that the system would expect. Of course, the tool would need to be able to generate XML messages on demand, accurately and according to our test scenarios.

Fortunately, in this engagement, we were working from a very well defined set of XML Schema Data (XSD), so the development of the tools that would generate the transaction messages was easy to test.

One tool was developed that was used to execute a set of SQL files against a MS-SQL Server defined in a configuration file. This tool would recursively search for all SQL files in a folder, execute the SQL query and send the data to a MS-Excel spread-sheet. This tool was used as a data mining tool used by manual testing.

Another set of tools were developed to generate a range of XML transaction files. The XML needed to simulate both inbound and outbound transactions, as the output would be used by manual testers, the data would then be modified by the tester to simulate various scenarios.

A tool was used to marshal the remote generation of the XML transaction files. The concept here is for the testers to send a request to generate XML to a remote machine where the XML would be generated and await pick-up by the tester.

This set of test harness devices represented a significant improvement in the ability of the testers to generate production quality transaction files in a fraction of the time that it takes a tester to produce the same amount of transactions and with a much lower margin of error.

Each of the tools developed for the client was unique and greatly improved the clients ability to successfully deliver the IT project. Incidentally, the client has since continued to use the same tools on a number of projects within their business with success.

Friday, 2 January 2009

XML Readers/Writers

Many applications that I write for clients are for the production or management of XML files. These files are used in a variety of ways, from the configuration of other applications, transmission of message data across a network, configuration of hardware and many, many more.

Most often it is required that a simple tool is provided for the clients employees to manage the XML data in a more human readable way, or with some level of automation using the clients business rules applied to the creation of the XML data. Typically, this is achieved by creating a GUI for the XML that is specific to the business function (occasionally more than one interface is required) so that the user of the data doesn’t have to learn a whole bunch of technology just to do their job.

Thursday, 1 January 2009

SQL To Oracle

One of the most common types of micro tool that I am called upon to develop is a tool for migrating data from one database system to another. Often, businesses will change their back end system and need to migrate their data to a new database server or a new schema. This can cause a real headache for the business because of the amount of valuable data that needs to be moved.

Sometimes the migration is a simple one to one movement of data because it is simply a database upgrade or server migration. More often, however, the migration is complex, requiring the remapping of data from one table to one or more tables.

When the migration is completed, you need to make sure that the data has been moved across correctly, that the information hasn’t been truncated, that the relationships between the data are maintained, etc..

Occasionally, this is done in stages and you want to make sure that you catch errors in translation as soon as they happen.

The tools that I have developed, in the past, go beyond the simple “row count” validation, but go right down into the guts of the databases and validate row by row, field by field. Once you decommission your old database server, it can be very costly to restore the data to correct errors or worse, pay your employees to re-key the data manually!