Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can write your own separate "Monkey Test" tool to do random clicks.</p> <p>To do that, get the bounds of your window and then clicks to random coordinates inside of that Rectangle. </p> <p>The code would look something like:</p> <pre><code>// 1) Find the process var processes = Process.GetProcessByName("MyWPFApp"); // 2) Get handle to its window, find its bounds/rectangle IntPtr handle = processes[0].MainWindowHandle; RECT rect; GetWindowRect(handle, out rect)); // 3) Send clicks to the window SendClicksToRect(rect); //you will need to implement this method, // it will use mouse_event() as mentioned here: https://stackoverflow.com/questions/2416748/how-to-simulate-mouse-click-in-c </code></pre> <p>(<em>NOTE that you will want to add error-checking, the code above does not do that</em>)</p> <p>Methods to use:</p> <ul> <li><p><a href="http://msdn.microsoft.com/en-us/library/z3w4xdc9.aspx" rel="nofollow noreferrer">Process.GetProcessesByName</a></p></li> <li><p><a href="http://pinvoke.net/default.aspx/user32.GetWindowRect" rel="nofollow noreferrer">GetWindowRect</a></p> <ul> <li>Note that this will require you to do a DllImport for this Win32/PInvoke method, it is not a part of the .Net Framework</li> </ul></li> <li><p>mouse_event: <a href="https://stackoverflow.com/questions/2416748/how-to-simulate-mouse-click-in-c">How to simulate Mouse Click in C#?</a></p></li> </ul> <p>The advantage of writing your own is that you can customize it do follow scenarios[*] that your user would, thus hitting more code than just randomly clicking around.</p> <p>[*] as in execute a scenario, and <em>then</em> do some random clicks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload