locked
Coded UI test issue with closed folder that contains EXE file RRS feed

  • Question

  • Hello,

    I have a question that concerns coded UI testing and need help about it. It's simple scenario. I have Windows Forms application (EXE file) and want to automate its UI tests. I'm able to record the tests. EXE file is in some folder: <path>/Debug. When that folder with EXE file is open running coded UI tests is fine and they pass. But, when I close that folder with EXE file and run the coded UI tests they fail. After I open the folder with EXE file again all works fine again.

    I've tried to set the path to EXE file manually (something like this: ... = @"c:/.../FileName.exe") in the source code and changed DoubleClick method through the code as well, but it's still not working. I know I could place shortcut to EXE file on desktop and record everything again, but what if I have many test projects with many coded UI tests? It would be too much shortcuts on desktop.

    I'm wondering if it's possible to keep the folder with EXE file closed and run the coded UI tests to pass in any way.

    Thank you in advance.


    Regards,

    Goran Tesic

     

    Tuesday, September 21, 2010 12:04 PM

Answers

  • I guess you are launching the application by doubleclicking the exe from the folder.

    You can launch your application by using

    ApplicationUnderTest.Launch(string filename);

    Ex: ApplicationUnderTest.Launch(@"C:\application\app1.exe");

     


    ---Mark the right post at right time---
    Cheers
    FunnyFox
    Tuesday, September 21, 2010 12:20 PM

All replies

  • I've tried to change one line of code in UIMap.Designer.cs file.

    Instead of this:

    this.mUIWindowsFormsApplicatListItem.SearchProperties[WinListItem.PropertyNames.Name] = "WindowsFormsApplication1.exe";

    I've put this:

    this.mUIWindowsFormsApplicatListItem.SearchProperties[WinListItem.PropertyNames.Name] = @"c:\...\Debug\WindowsFormsApplication1.exe";

    And the test fails.

     

    Tuesday, September 21, 2010 12:14 PM
  • I guess you are launching the application by doubleclicking the exe from the folder.

    You can launch your application by using

    ApplicationUnderTest.Launch(string filename);

    Ex: ApplicationUnderTest.Launch(@"C:\application\app1.exe");

     


    ---Mark the right post at right time---
    Cheers
    FunnyFox
    Tuesday, September 21, 2010 12:20 PM
  • This works fine.

    Thank you very much.

     

    Thursday, September 23, 2010 7:16 AM