Have you thought of including interactions with desktop applications in your tests?
In the “wide” web space you might find many tough ways to use a desktop application in a web test. The main aim of this post is to show you a very simple and fast way to achieve such an interaction.
Speaking from my own experience, I had to create a test that copies the content of a MS Word document in a web control and verify that the pasted content is correct. Since I started my career as a Quality assurance engineer, I had made only web automated tests and making a web test that opens MS Word was a challenge for me.
The tasks to overcome
The most common problems you would face when creating interaction between your web test and a certain desktop application are: how you could open the desktop application, how you could get its content and so on.
The first thing you have to decide is what tool you will use in order to test a desktop application together with a web page.
After some research I tried Sikuli. Sikuli is a tool used to automate and test graphical user interfaces using screenshot images. The tough part in using Sikuli was testing a web page because there was not an easy way to navigate to a page via the screenshot images, so that you can test the behavior of a web control and so on.
Both Sikuli and Telerik Testing Framework are free and here I will tell you why I chose the Telerik Testing Framework:
- It is the most convenient approach as I could easily integrate this kind of test with the existing suite of web-based unit tests already in place.
- It is easy and very intuitive to include the interaction with desktop application into a web test.
- I was able to easily create a data-driven test with more than 10 Word documents.
- There is no effort in creating a test for each browser as Telerik Testing Framework offers cross-browser test recording and execution.
Telerik Testing Framework gives you the opportunity to not only automate Browser Actions (DOM & UI) but to integrate your test with desktop applications too. You can set references to any namespace you would like to use in your test and extend the diversity of scenarios that a test may cover.
Time for some hands-on experience
I will present you an example of how you can make an automated test that pastes content from Word into a web module. Let’s now see how you can write a test in just four steps!
- Open the word document
In order to open the Word document I use the Process class of the System.Diagnostics namespace that gives you access to start or stop the local system processes on your machine. You just need the path to the document that you’d like to open and the name of its executable file:
Process process = Process.Start(
- Get the content and copy it in the clipboard
I found at least two ways to use keyboard interactions in your test:
- Paste in web control
I will show you an example with our RadEditor control from Telerik UI for ASP.NET AJAX:
RadEditor editor = Find.ById<RadEditor>(
Browser contentIframe = ActiveBrowser.Frames.ById(
- Verify that the pasted content is correct
//here in the quotes you should set the expected content
The following video shows how the execution of this kind of test goes if you are looking at the screen of the machine that runs it:
Other scenarios that might be covered using this approach:
- Taking an image from a specified folder and getting it to a web control
- Copying data from Word, Excel or other text document and pasting it in another application.
- Test exporting/importing documents (Markdown, PDF etc.) from web controls functionality
Of course, this is not all. Share your experience and what you build with your fellow QAs in the comments below!