web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Recorded test class - form missing

(0) ShareShare
ReportReport
Posted on by 3,262

Hi

After recording process addWorker and built the model, there is a running error: "Microsoft.Dynamics.TestTools.Dispatcher.Exceptions.DispatcherException: Could not attach to form: no open form with name 'Essentialsdashboard'."

As user option the initial page is "Essentials dashboard".

What more must be defined?

Thanks for help!

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    You started recording with "Essentials dashboard" already open but it's not open when running the test, right?

  • Jan M. Profile Picture
    3,262 on at

    How could it be, the test starts in VS or may on built server? Not sure what you mean.

  • Suggested answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Unfortunately you didn't answer my question, but I'll assume I'm right. I think you're talking about a UI test generated from task recording, which you started from a running form and therefore the test now expects the form running and tries to use it. As you see, it won't work. Create a new recording or modify the generated test code by hand.

    In your own interest, please get use to explaining your questions in details, so we don't have to guess what you need.

  • Jan M. Profile Picture
    3,262 on at

    Each recording leads to the same error, some page where you started from is not open. Same if the applicaton runs on the page. My expectation wouldn't be, that code has to be manualy corrected.

    I'm using Update6, selected all the form adaptor model referencies and checked "create form adaptors" of project properties. Finally couldn't find any generated classes.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    If it's true that you've recorded your tests correctly, the problem must be in how the tests are generated. In that case, create a support request with Microsoft.

    If you say that no test classes were generated, how you can they throw errors? :-)

  • Jan M. Profile Picture
    3,262 on at

    Of course the test class is there, but not the form adaptors, which in fact are not generated if also checked on model property. Dont know if they are needed just for executing and simulating the open form. May I try with the newest Update.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    If you tests use a form, they need do an adaptor for it.

  • sky_dynamic Profile Picture
    45 on at

    1. If You are trying to create new FormAdaptor classes make sure you are not getting bellow error in Output at the time of Build of your Project in VS(Form adapter classes should be generated successfully at the time of Build and then you can access your FormAdaptorclasses ):-

    Dynamics AX build step: Generate form adaptors started.

     Unable to generate form adaptors. Error = System.Exception: Cannot generate form adaptors for model "Your_Model". No model exists with Form Adaptor Source model pointing to this model.

      at Microsoft.Dynamics.Framework.Tools.BuildTasks.AsyncBuildController.DoFormAdaptorGeneration(CancellationToken token, IEnumerable`1 elements, BuildTrigger buildTrigger, IFormAdaptorGenerator formAdaptorGenerator).

    Dynamics AX build step: Generate form adaptors completed (27 ms).

    2. If  You record Test Case by TaskRecorder and You download the code and Import in VS, then there is 4 lines form closing auto generated code in TestMethod , remove that code and Build the Project and run or debug the test case again, it will work.

  • Jan M. Profile Picture
    3,262 on at

    There where no error on build and as I see no lines to remove.

    Recorded a simple create worker, the error is on line

    using (var c1 = c.attach(formStr(Essentialsdashboard)))


    This line needs to be added above:

    EssentialsdashboardFormAdaptor::open();


    Strange now, that it complains about fields readOnly at this line:

    HcmWorkerForm.HcmWorkerTitle_OfficeLocation().setValue(HcmWorker_HcmWorkerTitle_OfficeLocation);


    But the office location is an open field. What's the reason?

    Thanks.

  • Madiha13 Profile Picture
    5 on at

    Auto declaration of this field should be "Yes".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans