How to click on a button from another application | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to click on a button from another application

I have a application (c#, wpf), that I want to test. I can test this application to a certain extent. I can send data to the application which the application will process. However. Sometimes the application needs user input. Like a click on a button in a dialog. How can I simulate this click on a dialog button ?

24th Jan 2022, 7:24 PM
sneeze
sneeze - avatar
4 Answers
+ 4
Call the function you registered onclick
24th Jan 2022, 8:15 PM
Oma Falk
Oma Falk - avatar
+ 1
no way, (there is no legal way..) the fact is that each application runs in its own process, which is inaccessible from other processes, if it were possible, then there would be no protection, this would lead to chaos.
10th Feb 2022, 8:38 PM
Smith Welder
Smith Welder - avatar
0
Can't do that It is a dll. That is showing the dialog. I do not have access to the onclick event.
24th Jan 2022, 8:28 PM
sneeze
sneeze - avatar
0
Long long time ago. I have done it. Using winform and handle. You could search for a window and then analyse which button were on that window and click on a button. In wpf I have not seen it. https://docs.microsoft.com/en-us/answers/questions/702293/how-to-clicked-ok-button-of-messagebox-pops-up-on.html
10th Feb 2022, 8:50 PM
sneeze
sneeze - avatar