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 7941061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:33:11+00:00 2026-06-03T23:33:11+00:00

If I record actions to enter in login credentials into a dialog and call

  • 0

If I record actions to enter in login credentials into a dialog and call this Submit() in say UImap1.uitests. The autogenerated code will look something like this:

 public void Launch()
    {
        #region Variable Declarations
        WpfEdit uIUsernameBoxEdit = this.UIOCC600OILoginWindow.UIUsernameBoxEdit;
        WpfEdit uIPasswordBoxEdit = this.UIOCC600OILoginWindow.UIPasswordBoxEdit;
        WpfButton uIOKButton = this.UIOCC600OILoginWindow.UIOKButton;
        #endregion

        // Type 'username' in 'usernameBox' text box
        uIUsernameBoxEdit.Text = this.LaunchParams.UIUsernameBoxEditText;

        // Click 'passwordBox' text box
        Mouse.Click(uIPasswordBoxEdit, new Point(63, 13));

        // Type '********' in 'passwordBox' text box
        Keyboard.SendKeys(uIPasswordBoxEdit, this.LaunchParams.UIPasswordBoxEditSendKeys, true);

        // Click 'OK' button
        Mouse.Click(uIOKButton, new Point(33, 14));
    }

Now, if I manually launch the application under a method decorded with ClassInitialize in my in my CodedUI test class as follows:

      [ClassInitialize()]
        public static void MyTestInitialize(TestContext context)
        {
           Process.Start(@"C:\Program Files (x86)\MyCompany\MyApp.exe");
            Playback.Wait(2000);

            var uimap = new LaunchApplicationMap();
            var loginParams = uimap.EnterLoginCredentialsParams;
            loginParams.UIUsernameBoxEditText = "username";
            loginParams.UIPasswordBoxEditSendKeys = Playback.EncryptText("password
");
            uimap.Launch();
            Playback.Wait(5000);
        }

why do I get the following a null exception as shown below?

enter image description here

This is also the stack trace:

System.NullReferenceException was unhandled by user code
  Message=Object reference not set to an instance of an object.
  Source=Microsoft.VisualStudio.TestTools.UITest.Framework
  StackTrace:
       at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestService.TechnologyManagerByName(String technologyName)
       at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.ValidateSearchProperties()
       at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
       at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindControlIfNecessary()
       at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetProperty(String propertyName, Object value)
       at Microsoft.VisualStudio.TestTools.UITesting.WpfControls.WpfEdit.set_Text(String value)
       at UITests.UIMaps.LaunchApplicationMapClasses.LaunchApplicationMap.Launch() in C:\dev\OCC600\Source - Copy\Tests\UITests\UIMaps\LaunchApplicationMap.Designer.cs:line 44
       at UITests.LogsViewTests.MyTestInitialize(TestContext context) in C:\dev\OCC600\Source - Copy\Tests\UITests\LogsViewTests.cs:line 70
  InnerException: 

TIA.

  • 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-03T23:33:12+00:00Added an answer on June 3, 2026 at 11:33 pm

    You need to initialize the playback engine to use CodedUI outside of a test method. The framework automatically initializes playback/cleanup in the testinitalize/cleanup methods so you don’t see it in there.

    ClassInitialize/AssemblyInitialize happen before any tests begin so you have to call Playback.Initialize().

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

Sidebar

Related Questions

Basic doubt...If QTP generates vbscript code as we record actions, can't we directly write
I need to record the last login info of a user into the database.
I am searching for a web service which can record the actions done by
In Access 2007. We enter a new record on a form. Then we click
when I enter information into my form for a new page, it lets you
Scenario: I have multiple text boxes in which a user will enter data into
i want to create a NFC SmartPoster which dial a number with Action Record
I'm trying to create a record within a join table from the action of
I'm trying to create a record within a join table from the action of
def record return unless @supported klasses = profile_options[:formats].map { |f| RubyProf.const_get(#{f.to_s.camelize}Printer) }.compact klasses.each do

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.