Testing a desktop application - testing

I need to open a .exe application where I have to test all the functions, UI, etc.
I were working with watin and Nunit for testing a web, but now, i think watin is useless for this. I found NunitForms, but I dont think that will be enough.
I have to open the application and test all the windows, buttons, etc that appear. The application also start minimized in the taskbar and have a desplegable menu.
How can I handle it? Thanks!

I believe you are referring to Winforms application. Please check below links
The Microsoft UI Automation Library -
http://msdn.microsoft.com/en-us/site/cc163288
UI Automation with Windows PowerShell -
http://msdn.microsoft.com/en-us/site/cc163301
Lightweight UI Test Automation with .NET - http://msdn.microsoft.com/en-us/site/cc163864

Ideally, you want as little code in the forms as possible. If you move the functionality to separate classes, those can easily be tested using NUnit. If you must test the forms directly, NUnitForms is a reasonable tool.

Related

Is there a way to embed a debugger in a vb.net application?

There is a program/service running on different systems executing vb.net scripts.
The application running and managing the scripts is also written in vb.net.
I want to implement the option to debug the scripts directly on the different systems the scripts are running on.
So I am looking for a debugger that can be embedded in a vb.net application.
Ideally the solution would provide code highlighting, Watches, Stepping through the code,
a way to easily add libraries.
A colleague told me there is a way of embedding VS Code in an application, yet I have not found a way to implement the described requirements.

Can we Automate windows based application in AutoIT and integrate it in Selenium?

We have a huge application which is windows based(.Net), I know we can Automate and integrate some one click windows function in Selenium with the help of AutoIt But can we automate whole application with AutoIT and run it on Selenium ?
Or is not advisable to go for this option and use other tools such as UFT to automate web based applications ?
Selenium is a library which helps you to mimic user behavior in browser. If you want to automate windows desktop application, you don't need selenium in first place.
You might wanted to know whether one can use AutoIT with Java, instead of UFT/QTP for end to end testing of windows desktop based application. Yes, that's possible but it would not be that easy.
Consider following points:-
QTP/UFT provides in built mechanism to identify object and add it to Object Repository, If you use AutoIT, you need to implement mechanism which will provide an easy way to change/modify object in case of change in object of AUT. Writing object properties directly in code does not make much sense. refer image-
QTP/UFT provides in built support for Excel and sending data as parameter. If you have to do this in Automation Framework, it will require framework designing skill.
There are lot advantages of QTP/UFT which I'm not enlisting here. But if you have choice and budget, I will suggest to go with QTP.
Yes, you can write what ever script you need with AutoIt and call it your preferred code bindings (C#, Java or whatever you write your selenium tests in)
For example: How to call a script from java

Automation testing of application developed using WxWidgets

Is there a possibility to do a automation testing of application developed using WxWidgets on windows platform? If so how do I do that?
wxWidgets uses native widgets so any automated testing solution for Win32 programs would work with wxWidgets applications. However IME the typical "point-and-click" tests are not that great in practice and it's better to write the tests for the GUI code in the same way as you do it for the rest of the program.
There are two problems that need to be solved when doing it though: first, how to trigger various actions in the GUI. This is addressed by wxUIActionSimulator. It is not perfect, but if your application has a reasonable keyboard interface (as it should), it should be enough.
The second problem is related to the control flow in the GUI applications: if some action results in opening of a modal dialog, the test can't continue until the dialog is closed by user, which is inappropriate for unattended tests. wxWidgets provides (still somewhat experimental and not documented yet) wxTEST_DIALOG macro for dealing with this, its use is explained in this comment.
Combination of these two approaches allows to write tests for the real-life GUI applications and, moreover, the tests are portable and not limited to Windows platform.

Programmatically accessing an application through its UI

Earlier I asked a question about command-line parameters to automate processing of a file in InfoPath. I'll probably get the Tumbleweed badge for that one.
Instead of attempting a batch solution through the command line, can someone suggest a good resource for developing a solution that will open an application and then perform actions through the application's user interface like opening a file, printing it, and closing the file?
I've seen a legacy application do this in the past where it would open Attachmate and perform I/O operations through Attachmate's interface - but I never saw the code.
One constraint is that the process will be initiated from an existing .NET solution (i.e. processing 10,000 files). I am also unable to rely on traditional Office macros like those found in Excel - InfoPath does not appear to support them.
One option for automating a GUI based application is to use AutoIT. It will allow you to script the actions that are necessary for clicking menu interfaces, working with dialogs, etc.
Depending on your needs, you can create an AutoIT script on your dev machine, compile it to a standard EXE, and deploy it with the .NET project's compiled artifacts. To pass data to it, either you have your AutoIT script take command line parameters, or you have the .NET solution write a to a file with all the input file parameters and have the AutoIT script read in the file to process it. Based on the number you have in the question, I'd go with the option of writing to a file.
Since you are already on .NET you might want to give the new UI Automation framework a try. I haven't tried it yet, but it is supposed to work with WPF and native Win32 applications.
MSDN also has some samples: UI Automation Control Pattern Samples
Attachmate has a scripting language, an API and all kinds of other stuff to help with automating it. So this may not have been a typical application.
On the other hand, Attachmate products are (IMO) horrible to the extreme and I will go to great lengths to avoid working with them in the first place.

Tools for automating mouse and keyboard events sent to a windows application

What tools are useful for automating clicking through a windows form application? Is this even useful? I see the testers at my company doing this a great deal and it seems like a waste of time.
Check out https://github.com/TestStack/White and http://nunitforms.sourceforge.net/. We've used the White project with success.
Though they're mostly targeted at automating administration tasks or shortcuts for users, Autohotkey and AutoIT let you automate nearly anything you want as far as mouse/keyboard interaction.
Some of the mouse stuff can get tricky when the only way to really tell it what you want to click is an X,Y coordinate, but for automating entirely arbitrary tasks on a Windows machine, it does the trick.
Like I said, they're not necessarily intended for testing purposes, so they're not instrumented for unit test conventions. However, I use them all of the time to automate stuff that isn't testing related.
You can do it programmatically via the Microsoft UI Automation API. There's an MSDN Magazine article about it.
Integrates well with unit test frameworks. A better option than the coordinate-based script runners because you don't have to rewrite scripts when layouts change.
There's a couple out there. They all hook into the windows API to log item clicks, and then reproduce them to test.
We're now mostly web based (using WatiN), but we used to use Mercury Quicktest.
Don't use Quicktest, it's awful for a tremendously long list of reasons.
This is what i was looking for.
Check out http://www.codeplex.com/white and http://nunitforms.sourceforge.net/. We've used the White project with success.