title: Using Coded UI to Simulate File Drag and Drop Operation
body: <p>I have a WinForm application which is a drop target for files and folders. I'd like to use Coded UI to have an automated tests that verifies the application does what I think it should do when files were dropped on it.</p>
  
  <p>I used the Coded UI recorder to record this operation, but I need to generalize it and make it work on CI server. So I basically want to init the test with some pre-setup file paths (the files can be created as part of the test setup), and then just trigger the drop event passing in the paths to those files on the file system.</p>
  
  <p>Coded UI records the test but produces a test like:</p>
  
  <pre><code>WinListItem uIContactcshtmlListItem = this.UIProgramManagerWindow.UIDesktopList.UIContactcshtmlListItem;
  WinText uIDragDropFilesHereText = this.UIMyApp.UIDragDropFilesHereWindow.UIDragDropFilesHereText;
  uIDragDropFilesHereText.EnsureClickable(new Point(84, 13));
  Mouse.StartDragging(uIContactcshtmlListItem, new Point(17, 35));
  Mouse.StopDragging(uIDragDropFilesHereText, new Point(84, 13));
  </code></pre>
  
  <p>The "uIContactcshtmlListItem" appears to represent the source files I dropped. (A contacts.cs file happens to be one of the things I dragged/dropped during the recording.) I want to replace this with just some file paths, but this appears to essentially be a list item type control from Explorer.</p>
  
  <p>Is there a way to accomplish what I want? Perhaps by creating a WinListItem in the code manually?</p>