Team System Developer Center > Visual Studio Team System Forums > Visual Studio Team System 2010 Beta2 > Returning to BETA 1 style Object Declarations in CodedUI Tests
Ask a questionAsk a question
 

Proposed AnswerReturning to BETA 1 style Object Declarations in CodedUI Tests

  • Tuesday, October 27, 2009 11:59 AMBaaleos Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    No offence like, but the New Mode of Displaying the object declarations is entirely inferior to what Beta 1 was like.

    Beta 1 was like this

     

     

    WpfWindow wpfWindow = new WpfWindow();
    
    #region Search Criteria
    
    wpfWindow.SearchProperties.AddRange(new PropertyExpression("Name", "Company Name - Product Name"), new PropertyExpression("ClassName", "HwndWrapper", PropertyExpressionOperator.Contains));
    
    #endregion
    
    WpfCustom PaneListCustom = new WpfCustom(wpfWindow);
    
    #region Search Criteria
    
    PaneListCustom .SearchProperties.Add("ClassName", "Uia.ContentPane", "Friendly Name", "My Pane");
    
    #endregion
    
    




    However - Now Beta 2 Records objects like this

     

     

    this.UIMap.RecordedMethod1();

     

     

    Which then has the contents of

    #region Variable Declarations
                WpfText Text = this.UIProductMainWindow.Z948e828dc9fa48c8927Custom.MainContentTabList.WindowTabPage.Text;
                #endregion
    

    If I then want to see the search criteria for each of these individual parts, I need to right click on that object, and then see the definition. Even then... im noticing it is not showing me Search Criteria. Meaning it becomes that much harder to program methods which can locate dynamically changing objects.

    Please tell me there is an option that will let me switch back to Beta 1's recording/search criteria mode.

All Replies

  • Tuesday, October 27, 2009 4:14 PMGautam Goenka [MSFT] Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    No, there no way to switch back to Beta 1 style of code generation.

    In the new code generation, the class is split into two partial classes.  So in UIMap.cs, you can add a constructor and add code to customize the search properties of corresponding control.

    Will the above work?

    Thanks.