It is me

" />

Archive for the ‘Uncategorized’ Category

Audit Trail – Tracing Data Changes in Database

Uncategorized | Posted by Petr Kozelek
Aug 30 2010

The common requirement in many enterprise applications is logging of data changes in a database – what data has changed, who changed them and when (audit logging). Bloggers published many articles about this old problem but there is only few general approaches how to do that in relational databases. Read more »

Speed Up Typing Text with WatiN

Uncategorized | Posted by Petr Kozelek
Aug 05 2010

I use WatiN for UA testing and I was facing the problem that WatiN is slow while typing text into text field with TextField.TypeText(string) method.

TypeText(string) is slow because during run it fires sequences of key events: KeyDown(char), KeyPress(char), KeyUp(char). The sequence is invoked as many times as the length of the input string is. As the result, the input text is typed to the text field one by one char. It is slow and when you have hundreds of tests then you wait tens of minutes for their execution! I created simple extension method to speed up typing of text markedly – for a string 10 chars long the performance of typing is around 30 times higher.

public static class WatiNExtensions
{
    public static void TypeTextQuickly(this TextField textField, string text)
    {
        textField.SetAttributeValue("value", text);
    }
}

In my solution I do not use simulated key events. I use direct setting of value attribute in text field. The limitation of this solution is that it does not raise focus and blur events. Additionally, no key events are fired.

Usage is simple:

var browser = new IE("http://google.com");
browser.TextField("q").TypeTextQuickly("WatiN"); // fast - raises neither key events nor focus and blur on text field
// browser.TextField("q").TypeText("WatiN"); // slow - raises key events

Porting a Subversion to a Git Repository with an Error “Permission denied: Can’t open ‘/tmp/report.tmp’”

Uncategorized | Posted by Petr Kozelek
Jan 20 2010

I was dealing with a problem of converting existing Subversion repository to a new git repository on my local Windows XP station. Read more »