GWT 1.5 Tree and RichTextArea testing with Selenium

Last couple weeks I have been working in a project which utilizes Google Web Toolkit for the user interface. The development has been quite straightforward but testing has caused some headaches.

We are using GWT 1.5 RC 2 and one of the new features compared to 1.4 is the debug id. It allows to set a specific id for most of the elements by calling onEnsureDebugId method. This addition in UIObject helps Selenium testing because elements can be referred with their id instead of xpath.

But the first problem came up with Tree and TreeItem. Expanding tree with Selenium RC test case was tricky. Clicking those plus and minus images was quite impossible because I did not manage to set an id for them. After several attempts I decided to use double clicking to expand a tree item. This was also easy on the test side as Selenium has doubleClick command and the tree item itself can have a debug id.

The second problem was with GWT's RichTextArea. I wanted to type text in the area but Selenium IDE did not recognize or record my typing. The problem here was the iframe used by the editor. Some searching revealed that most WYSIWYG editors have the same testing issue. The solution was to select the right frame with Selenium's selectFrame, type text to //body/html and finally select the top frame again.

Comments

No comments yet

Add Comments



cialis order cialis online cialis order cheap generic cialis buy cheap cialis