Click here to Skip to main content
14,978,778 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: UI not updating Pin
#realJSOP30-Mar-21 5:12
mva#realJSOP30-Mar-21 5:12 
GeneralRe: UI not updating Pin
#realJSOP30-Mar-21 12:14
mva#realJSOP30-Mar-21 12:14 
GeneralRe: UI not updating Pin
#realJSOP30-Mar-21 14:26
mva#realJSOP30-Mar-21 14:26 
QuestionImpossible? Get instance of MainWindow from extern WPF-application Pin
Mc_Topaz22-Mar-21 14:05
MemberMc_Topaz22-Mar-21 14:05 
AnswerRe: Impossible? Get instance of MainWindow from extern WPF-application Pin
Richard Deeming22-Mar-21 22:40
mveRichard Deeming22-Mar-21 22:40 
GeneralRe: Impossible? Get instance of MainWindow from extern WPF-application Pin
Mc_Topaz23-Mar-21 4:02
MemberMc_Topaz23-Mar-21 4:02 
AnswerRe: Impossible? Get instance of MainWindow from extern WPF-application Pin
Gerry Schmitz23-Mar-21 7:27
mveGerry Schmitz23-Mar-21 7:27 
GeneralRe: Impossible? Get instance of MainWindow from extern WPF-application Pin
Mc_Topaz23-Mar-21 12:22
MemberMc_Topaz23-Mar-21 12:22 
It might be time to tell the my idéa.

B is a WPF-application my company has. We don't have any unit test for the GUI of B. We want that.

So I thought if:
* B is a WPF-project in our Visual Studio solution.
* A is a unit test project in the same solution.
* A has some "code/package/NuGet" to start, terminate B and gain access of all public controls in B.
* In A we write the unit tests that use the "code/package/NuGet" to access the controls in B to do our unit tests.

For instance if I want to test a button's click event in B:
1) In A: Run a specific test case.
2) In A: Start B.
3) In A: Someway gain access of all public controls of B.
4) In A: Put a text in a TextBox located in B.
5) In A: Trigger the click event of a Button located in B.
6) In B: The Button's click event puts the TextBox's text in a TextBlock.
7) In A: Read the Text from the TextBlock inside of B.
8) In A: Verify the text and pass or fail the test.
9) In A: Terminate B.


I have looked at Appium with the WinAppDriver solution. That works, but it requires the WinAppDriver application running in the background to handle all communications between A and B. I don't want a third party or be forced to write any IPC in B.
Unit test should be easy to write and run. If each develop must install the WinAppDriver to run tests, it's just tedious.
However, I like the way that WinAppDriver use the AutomationProperties.AutomationId and other properties on controls to allow "A" to access it "B". I would like a similar solution.


@Gerry Schmitz
How should I do to instantiate B in A?
If that give me access to all public controls, that will be fine!


Best regards,
/Steffe
GeneralRe: Impossible? Get instance of MainWindow from extern WPF-application Pin
Richard Deeming23-Mar-21 23:14
mveRichard Deeming23-Mar-21 23:14 
GeneralRe: Impossible? Get instance of MainWindow from extern WPF-application Pin
Gerry Schmitz24-Mar-21 5:40
mveGerry Schmitz24-Mar-21 5:40 
GeneralRe: Impossible? Get instance of MainWindow from extern WPF-application Pin
Mc_Topaz25-Mar-21 0:02
MemberMc_Topaz25-Mar-21 0:02 
QuestionWPF DataGrid Custom Group Header Pin
Kevin Marois22-Mar-21 8:47
professionalKevin Marois22-Mar-21 8:47 
AnswerRe: WPF DataGrid Custom Group Header Pin
Richard Deeming22-Mar-21 22:35
mveRichard Deeming22-Mar-21 22:35 
QuestionDynamic WPF DataGrid Pin
Kevin Marois19-Mar-21 10:41
professionalKevin Marois19-Mar-21 10:41 
AnswerRe: Dynamic WPF DataGrid Pin
Richard Deeming21-Mar-21 22:50
mveRichard Deeming21-Mar-21 22:50 
GeneralRe: Dynamic WPF DataGrid Pin
Kevin Marois22-Mar-21 7:07
professionalKevin Marois22-Mar-21 7:07 
GeneralRe: Dynamic WPF DataGrid Pin
Kevin Marois23-Mar-21 9:58
professionalKevin Marois23-Mar-21 9:58 
GeneralRe: Dynamic WPF DataGrid Pin
Richard Deeming23-Mar-21 23:13
mveRichard Deeming23-Mar-21 23:13 
GeneralRe: Dynamic WPF DataGrid Pin
Kevin Marois24-Mar-21 6:14
professionalKevin Marois24-Mar-21 6:14 
QuestionWPF with TPL Multithreading Pin
#realJSOP16-Mar-21 6:04
mva#realJSOP16-Mar-21 6:04 
AnswerRe: WPF with TPL Multithreading Pin
Gerry Schmitz16-Mar-21 7:45
mveGerry Schmitz16-Mar-21 7:45 
GeneralRe: WPF with TPL Multithreading Pin
#realJSOP16-Mar-21 9:03
mva#realJSOP16-Mar-21 9:03 
GeneralRe: WPF with TPL Multithreading Pin
Gerry Schmitz16-Mar-21 10:11
mveGerry Schmitz16-Mar-21 10:11 
GeneralRe: WPF with TPL Multithreading Pin
#realJSOP16-Mar-21 10:51
mva#realJSOP16-Mar-21 10:51 
QuestionExpand/Collapse TreeView Nodes on Ctrl+LeftMouse in WPF Pin
earnshaw194312-Mar-21 4:24
Memberearnshaw194312-Mar-21 4:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.