none
Visual Studio 2010 - Coded UI - Best way to edit mapped UI Controls?

    Question

  • Is there any simple way to add a method or property to a mapped UI Control?

    The generated code for a control in a SilverlightTable does not work when there are multiple buttons with the same name in the same table. I am able to edit the generated code to be able to search by the row#, but I had to comment out the code in the UIMap.Designer.cs. Every time I generate new code, the UIMap.Designer file overwrites my comments as expected. There is a way to move generated methods over to the UIMap, but not mapped ui controls.

    Other then renaming the UI Controls, which will take a long time, since the UIMap is large, is there a simple way to add a method to a control?

    Tuesday, June 04, 2013 8:12 PM

Answers

  • Hello,

    Thank you for your post.

    As far as I know, Silverlight 3 and Silverlight 5 are not supported by Visual Studio 2010 Coded UI test. And we can create coded UI tests and action recordings for Silverlight 4 applications by using Microsoft Visual Studio 2010 Feature Pack 2.

    For more information, please see:

    Supported Configurations and Platforms for Coded UI Tests and Action Recordings

    In addition, if you want to move the generated method, edit it but the UIMap.Designer.cs file will not overwrites the changed code, I suggest that you try to move the recorded method to UIMap class in UIMap.cs which is where you can create custom code to extend the functionality of the UIMap class. The code that you create in this file will not be regenerated by the Coded UI Test Builder every time that a test is modified.

    You can do that through opening the UIMap.uitest as Coded UI test Editor and right click the target method and select ‘move’.

    You can do that to check if it can meet your requirements.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 05, 2013 9:24 AM

All replies

  • Hello,

    Thank you for your post.

    As far as I know, Silverlight 3 and Silverlight 5 are not supported by Visual Studio 2010 Coded UI test. And we can create coded UI tests and action recordings for Silverlight 4 applications by using Microsoft Visual Studio 2010 Feature Pack 2.

    For more information, please see:

    Supported Configurations and Platforms for Coded UI Tests and Action Recordings

    In addition, if you want to move the generated method, edit it but the UIMap.Designer.cs file will not overwrites the changed code, I suggest that you try to move the recorded method to UIMap class in UIMap.cs which is where you can create custom code to extend the functionality of the UIMap class. The code that you create in this file will not be regenerated by the Coded UI Test Builder every time that a test is modified.

    You can do that through opening the UIMap.uitest as Coded UI test Editor and right click the target method and select ‘move’.

    You can do that to check if it can meet your requirements.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 05, 2013 9:24 AM
  • Hi Amanda,

    I am not convinced this answers the question:

    stealth_nat has said "Every time I generate new code, the UIMap.Designer file overwrites my comments as expected. There is a way to move generated methods over to the UIMap, but not mapped ui controls."

    As far as I can see, your answer only demonstrates how to customise actions and assertions which (based on the exceprt above) I can only assume stealth_nat is already aware of.

    Forgive me if I am mistaken but I have logged a similar question and I think I am getting at the same problem:

    http : / /social.msdn.microsoft.com/Forums/en-US/504feb9c-8416-4d70-8fa0-8c398dfd67c8/parametrized-coded-ui-test-edit-ui-control-map

    (forgive the whitespace, apparently I cannot add links until my account is verified).

    Wednesday, October 02, 2013 2:59 PM