Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe your problem is with the window title. You see that Visual Studio will give a window title to each new window generated in your application. When you recorded your test, your window's title was "Form1". It says so in your error message:</p> <p>ControlType: 'Window' Name: 'Form1' </p> <p>So what you need to determine is if your application renames the window each time a new window is opened (most likely it does). For instance, if you open a second window, it might be called "Form2". </p> <p>For the coded ui test to work properly, it needs to know where to look for certain controls to perform its actions on. So, it will need to know the window title to be able to "select a textbox, type in a random value, them click a button." </p> <p>The only way I have found to fix this problem is to set the window title manually if i know it has changed, or will change. </p> <pre><code>this.UIMap.UIHighCapitalFranchiseWindow.UIHighCapitalFranchiseDocument.UICtl00ContentPlaceHolComboBox.WindowTitles.Clear(); this.UIMap.UIHighCapitalFranchiseWindow.UIHighCapitalFranchiseDocument.UICtl00ContentPlaceHolComboBox.WindowTitles.Add("Franchises for Sale"); </code></pre> <p>As you can see, I am just clearing all the values in the WindowTitles property of the control, then adding the correct title, the one I know it should be. In the above example it is organized as follows:</p> <p>this.(name of your uimap file).(name of your window).(name of the document in the window).(name of the certain control (combo box, radio button, text box etc)).WindowTitles.(clear or add)();</p> <p>This code can go right in the coded ui test file, or if you want to use the partial class UIMap.cs (the one that is not auto generated, UIMap.Designer.cs is the auto generated one) to make changes to the UIMap. Just remember to remove the ".UIMap" if you choose the latter.</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