none
Coded UI using more than one cs file

    Question

  • It is possible to organise Coded UI tests into more than one CodedUITest.cs file?

    I currently have a sample set of 43 tests in one CodedUITest.cs file, and the file is already 5700 lines long. It seems to me that as the number of tests increases the file is going to get harder and harder to manage. I can find lots of guidance about using multiple Map files, but none about using multiple cs files.

    Tuesday, May 17, 2016 1:55 PM

Answers

  • Hi Robert.Warren,

    According to your description, you want to divide your existing CodedUITest.cs file into multiple cs file, is it right?

    Please try with following steps to implement your requirement.

    1. Right-click your Coded UI Test project and choose Add -> Coded UI Test.
    2. It will pop up a window to let you choose generate Coded UI Test code using Coded UI Test Builder or using Existing Action Recording. Please choose none of them, click the cancel button directly.
    3. Please copy the UIMap property code from original CodedUITest.cs file to the new added cs file.
    4. Cut and past the Coded UI Tests that you want to divide to  the new CodedUITest.cs file. Then these tests will be divided into another cs file.
    5. Do the same steps from step 1 to step 4 to add multiple cs files.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Robert.Warren Wednesday, May 18, 2016 9:27 AM
    Wednesday, May 18, 2016 8:22 AM
    Moderator

All replies

  • Hi Robert.Warren,

    According to your description, you want to divide your existing CodedUITest.cs file into multiple cs file, is it right?

    Please try with following steps to implement your requirement.

    1. Right-click your Coded UI Test project and choose Add -> Coded UI Test.
    2. It will pop up a window to let you choose generate Coded UI Test code using Coded UI Test Builder or using Existing Action Recording. Please choose none of them, click the cancel button directly.
    3. Please copy the UIMap property code from original CodedUITest.cs file to the new added cs file.
    4. Cut and past the Coded UI Tests that you want to divide to  the new CodedUITest.cs file. Then these tests will be divided into another cs file.
    5. Do the same steps from step 1 to step 4 to add multiple cs files.

    Best Regards,
    Weiwei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Robert.Warren Wednesday, May 18, 2016 9:27 AM
    Wednesday, May 18, 2016 8:22 AM
    Moderator
  • Thanks - that worked perfectly
    Wednesday, May 18, 2016 9:27 AM