Click here to Skip to main content
15,878,959 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Opinions requested, please. I lave a large C# application that primarily has many custom data entry pages. It also produces on-screen graphics.

I want to produce a test application to controlthe target application via the UI. I can make minor mods to the target,such as adding AutomationId to the various UI elements for easier access.

My question:
What are the preferred test platforms? I wouldlike the test app to use C#, but am comfortable with Python, Java, and other languages.

TIA

What I have tried:

Most of my searching has yielded 10+ year old advice, or general automation information,such as for unit testing.
Posted
Updated 26-May-23 11:18am

1 solution

There is no information given on how the application was built.

This is where thee Mvvm design pattern excels. It allows for Unit testing - ref: MVVM - Writing a Testable Presentation Layer with MVVM | Microsoft Learn[^]

For UI testing, look at using AutomationPeer: UI Automation of a Custom Control - WPF .NET Framework | Microsoft Learn[^]
 
Share this answer
 
Comments
richwfowler 26-May-23 21:41pm    
Thank you Graeme_Grant. Not sure how to answer yout "How is it built" question. I will need to treat he target app as a "Black Box", except I am one of the developers. It does use MVVM patterns. It also has extensive unit testing. The customer is requesting testing at he UI levelas well.

I will review AutomationPeer - I haven't seen this one before
Graeme_Grant 26-May-23 21:50pm    
If the ViewModel, Model, service, etc, and they have one or more public methods with a return value, then you can run a unit test against it.

I like to use xUnit[^] and Fluent Assertions[^] for testing.
[no name] 27-May-23 1:05am    
Can't see it. What with scroll bars, view ports, view boxes, sliders, ... You have acceptance tests (scripts) for a given use case. Once upon a time there were only textboxes and buttons. If that is "how your app is built", then I would say automation is "feasible"; otherwise, it's just pain.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900