locked
Move all of generated code in designer.cs to .cs file and leave designer.cs file blank RRS feed

  • Question

  • anyone has tried this?

    Move the contents of designer.cs file to .cs file and leave the designer.cs file blank.

    Reorganize the generated code in .cs file.

    When a ui change happens,move the changed part .cs file

    When tests are run, designer.cs file are always blank.

    Friday, August 10, 2012 2:36 PM

Answers

  • Hi Grace,

    You can move your generated code and edit it very easily if you have Feature Pack 2 installed. It allows you to use the Coded UI Test Editor.

    If you want to move all of your code, you will have to move each recorded method one by one. 

    1. Open your .uitest file in the coded UI Test editor by double-clicking on the file.

    2. Right click on the method you want , and click Move.

    3. Save when done, and you will see the method in your UIMap.cs file.

    4. Repeat 1 - 3

    Reference bellow:

    How to move generated code using Coded UI Test Editor

    Link to the VS Feature Pack overview page.

    Please note that if you just cut and paste your code into a new .cs file, next time your UI changes and you have to add to your CUIT, the .designer.cs file will go back to its previous state (before you copied and pasted).

    Refer to this thread  about making changes to your generated code.

    Hope this helps,

    Nat




    Friday, August 10, 2012 3:12 PM