Click here to Skip to main content
16,015,296 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

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.
If you are still looking for a solution, I have automated an windows application [WPF] with Java and Appium[selenium], you can also use C# which will also work. I have also used winApp driver to locate the elements.
 
Share this answer
 
v2
WOW I forgot I asked this question a year ago!!!
Thank you for your response.


I settled on custom C# code that uses FlaUI as the base library. Works sufficiently well.
 
Share this answer
 
Comments
CHill60 10-Jun-24 3:11am    
If you want to comment on a solution use the "have a Question or Comment?" link next to it. The poster will be notified of your response. Post a solution to your own question and they will not.

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