How to test WPF components using NUnit? - nunit

I am trying to test each components of my WPF application by using NUnit. But how to test the graphical components like button, grid, textblock, richtextbox etc?

Take a look at Teststack.White
.
Pretty easy to use:
Start application.
Attach app process.
Find Window by (SearchCriteria).
Get element you want to test by Window.Get(SearchCriteria)
Test whatever you want
Tutorial Link
Cheers

Related

GWT GUI testing

I have just started working on GWT as my company is using it. However the problem is , there is not much documentation or tutorial.
I have created a dummy app as given in GWT tutorial.
The app create a GUI like this. I am able to write test cases, for functional use case, but I am not sure how to test the GUI components. For e.g. If i press on add button , it should add a row to table, how can i write the test for this.
Note: I was tryin to do GWTMockito, but was unable to find any resource.
Any help would be really appreciated.

Delphi Popup Window/Form

I am new to Delphi and I am using RAD Studios XE8. I am developing a windows program that needs an options button. I am trying to create a form that when the button is hit, it opens the form. I am having trouble finding out how to do this or a tutorial online. Any insight would be helpful such as what I should google, or a link to a tutorial on how to do this or a walk-though video. I have a strong feeling that I may be using the wrong terminology as well. Any help would be nice.
Here is something to get you started:
Create a forms application (eg. with main form named Form1)
Create a second form (eg. with name Form2)
Create a button on first form in designer
Double click the button in the designer
IDE will open editor and create a handler for you - this is where you have to put the following code: Form2.Show();
Run and test
I would advise you try at least several tutorials like these before trying to write your own program:
Delphi for beginners: My First Delphi Program
Simple calculator tutorial

Auto form filling

I have a requirement like I need to fill an online form automatically. (Auto form filling).
Means I need to create an application in which clicking on the "Auto fill” button it will open the form in browser (form is another website page) and fill the data automatically.
The data (which may change each time) I will supply from my application. So first I thought of implementing the functionality using iMacro.
But later I realized I can’t call this imacro from an application if it is free version. So please suggest me some idea to achieve this functionality.
Thanks.
as far as i under stand your problem i would say try sikuli ..it just a simple you can say a compiler and a language which uses image recognition and you can make autobot through this and a very easy to learn ..

UI Automation Verify v/s UISpy - The way they find UI elements

I am trying to automate UI interactions for a C++ MFC application. I tried to find elements' automation ID using UISpy and UIAVerify tools. I am on win2k3.
There is a tab control, the automation ID of which is visible to UISpy but not to UIAVerify.
The issue is - it is not visible even to the C# code that I write using Project White framework or ui automation framework of .net 3.0.
I want to get handle to this control the way UISpy gets it. Is there any way I can find out how UISpy does it?
Thanks!!!
UISpy is likely using Microsoft UI Automation under the covers. You can see how this works from this example*. There are all kinds of conditions on AutomationElement which you can use to locate them.
I've only worked with WPF tabs, but found it really, really hard to locate them by Automation Id. Instead I've been using the AutomationName property, with the title on the tab as the value. Not sure if White supports this, but I'm pretty sure you can get the original AutomationElement out and use it as per the example.
You'll also probably be looking for something supporting the SelectionItemPattern (there's a SelectionItemIsSupportedProperty), and you'll need to use the pattern to select the tab and make it active before you can see anything in it.
Please comment if you need any more info. It might help to know what the structure of your container with tabs in is.
*Declaration of interest since I wrote this.

Testing Facebook application written using GWT

I'm currently writing a facebook application using GWT on Eclipse, how can I test the application with all the interaction??
If you mean how can you write tests for your whole working application, you might want to have a look at Selenium (http://seleniumhq.org/). There are a variety of ways of using it, but essentially you can use it to automate a browser and click on elements, enter text, verify that you can see the correct result.
With GWT you will need to use "ensureDebugId" method on UiObject and add
to your gwt.xml file so that you get repeatable element ids that you can use in your tests.