Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7788451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:00:25+00:00 2026-06-01T21:00:25+00:00

I would like to add a handwritten coded control to my UIMap.cs (not UIMap.Designer.cs).

  • 0

I would like to add a handwritten coded control to my UIMap.cs (not UIMap.Designer.cs).

For example, when I record: writing in a texBox, I get the following code in UIMap.Designer.cs:

public class Recorded_Writing_In_forRecordParams
{
    public string UIForRecordEditText = "forRecord";
}

public class UIMainWindowWindow : WpfWindow
{
    public UIMainWindowWindow()
    {
        this.SearchProperties[WpfWindow.PropertyNames.Name] = "MainWindow";
        this.SearchProperties.Add(new PropertyExpression(WpfWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
        this.WindowTitles.Add("MainWindow");
    }

    public WpfEdit UIForRecordEdit
    {
        get
        {
            if ((this.mUIForRecordEdit == null))
            {
                this.mUIForRecordEdit = new WpfEdit(this);
                this.mUIForRecordEdit.SearchProperties[WpfEdit.PropertyNames.AutomationId] = "forRecord";
                this.mUIForRecordEdit.WindowTitles.Add("MainWindow");
            }

            return this.mUIForRecordEdit;
        }
    }

    private WpfEdit mUIForRecordEdit;
}

I want use this control in my CodedUITest. Is there a way to search the TextBox in the UIMap.cs by own coded or to search it in my TestMethod? Which is the best way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:00:27+00:00Added an answer on June 1, 2026 at 9:00 pm

    Thanks for the answer, but I solved my problem on my own with the following way:

    UIMap.cs

    public partial class TestLittleAppUIMap
    {
        private MyWindow mMyWindow;
        public MyWindow MMyWindow
        {
            get
            {
                if (this.mMyWindow == null)
                {
                    this.mMyWindow = new MyWindow();
                }
                return this.mMyWindow;
            }
        }
    }
    
    public class MyWindow : WpfWindow
    { 
        private WpfEdit mWpfEdit;
    
        public MyWindow()
        {
            this.SearchProperties[WpfWindow.PropertyNames.Name] = "MainWindow";
            this.SearchProperties.Add(new PropertyExpression(WpfWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
            this.WindowTitles.Add("MainWindow");
        }
    
        public WpfEdit MWpfEdit
        {
            get
            {
                if ((this.mWpfEdit == null))
                {
                    this.mWpfEdit = new WpfEdit(this);
                    #region Search Criteria
                    this.mWpfEdit.SearchProperties[WpfEdit.PropertyNames.AutomationId] = "forOwn";
                    this.mWpfEdit.WindowTitles.Add("MainWindow");
                    #endregion
                }
                return this.mWpfEdit;
            }
        }
    

    CodedUI Test

    [TestMethod]
    public void TestLittleAppOwnMap()
    {
        this.UIMap.MMyWindow.MWpfEdit.DrawHighlight();
        Playback.Wait(2500);
    }
    

    It is almost a copy of the designer class.

    For searching directly in the TestMethod you can go like this:

    [TestMethod]
    public void TestLittleAppOwn()
    {
        WpfWindow w = new WpfWindow();
        w.SearchProperties[WpfWindow.PropertyNames.Name] = "MainWindow";
        w.SearchProperties.Add(new PropertyExpression(WpfWindow.PropertyNames.ClassName, "HwndWrapper", PropertyExpressionOperator.Contains));
        w.DrawHighlight();
    
        WpfEdit e = new WpfEdit(w);
        e.SearchProperties[WpfEdit.PropertyNames.AutomationId] = "forOwn";
        e.SetProperty("Text","myText");
        e.DrawHighlight();
        Playback.Wait(2500);
    }
    

    Where Playback.Wait just wait a short time for showing the Highlight.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like add a this Apple example [AccelerometerGraph] the ability to store the
I would like to add the following MIME type to a site run by
I would like to add a DataGridViewTextBoxCell cell to a DataGridViewCell control, but as
I would like to add some paragraphs or new lines or words dynamically but
I would like to add a field to the Django FlatPage database model, but
I would like restfully add a parameter to the new named path. So for
I would like to add some custom data to an image the user generates
I would like to add authentication to my Rails app. I came across few
I would like to add an overlay image on a Google Map. The image
I would like to add an item into a picture Library using c#. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.