Greetings everyone. I am very happy to announce that I have found a way to automate testing in XPages.
I attended Microsoft’s Tech Ed Event last year, and one of the tools that impressed me heavily, was Visual Studio’s Unit Testing Automation. What I enjoyed most was how you could setup a Test Case by recording what you were doing on the Screen, and then playback that Test Case. What was even more impressive was when the Test Case failed. When this happened, Visual Studio would take you to the line in your code where the Test Case failed.
Now, this is probably old news for Visual Studio Developers, but it’s quite rare for Domino Developers to have this capability. I’ve searched online and have not found any Testing Automation Toolkit for the physical Lotus Notes Client as yet, but I did stumble upon Selenium, which I am now using to automate testing in my XPages Applications.
What Is Selenium
The following extract is from Selenium’s Home Page:
Selenium automates browsers. That’s it. What you do with that power is entirely up to you. Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well.
Selenium has the support of some of the largest browser vendors who have taken (or are taking) steps to make Selenium a native part of their browser. It is also the core technology in countless other browser automation tools, APIs and frameworks.
For our purpose though, Selenium provides a means of recording your Xpages Testing, and then re-running that test or tests. The below video will show you how I setup and run a Test Case using Selenium IDE on our Online XPages Showcase. You’re more than welcome to use our Showcase to test Selenium. The below video was published through David Leedy’s NotesIn9 Series. Be sure to check out more videos from his Website, or through iTunes.
A few important Notes when Testing with Selenium
1. Selenium IDE is a Firefox Add-On. I’m not aware of any other Add-On for IE, Chrome, etc.
2. From what I’ve read, Selenium IDE gives you a small taste of what Selenium can actually do. I’ve however not had the time to explore this product any further.
3. From the feedback I’ve received and from my own tests, it seems that Selenium struggles a bit when it comes to testing certain Dojo and JQuery Controls. I will be testing this further, and will update this Blog Post as soon as I find a way around this. I am also expecting a lot of feedback from the Community, who I hope will also list many Tips, tricks etc.
That’s it from me. Enjoy the Video, and please leave feedback if and when you have time.