Testing plugins converted fo Dynamics 365 online using Visual Studio and PRT

CRM 2013, Dynamics 365 online

I am looking for a method to test plugins converted for D365 from CRM 2013.  With a Dev environment, how can this be done using Visual Studio and the PRT?

Ideas are: on Dev, if we register the plug-in assembly, ,register a plug-in step for an event and test its execution by doing whatever is shown in the code.  For example, step through the code as a plugin and test that it performs the actions in the CRM 2013.

Questions: can Visual Studio be used in Debug mode to step through the code and provide an adequate test?  Can the PRT be used to view the registered plugin and verify that the plugin ran as expected?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

apollo7Author Commented:
Let me know if the following steps are correct or could be done in a different way:

Dev Environment Testing

•      Select Create New Connection
•      Select Office365 Type Connection
•      Register New Assembly
•      Browse for dll (PluginTest.dll)
•      This should show it is isolatable
•      Register New Step
•      Execute an event that triggers the plugin or step through the code in Debug mode to reveal any errors.
•      Highlight any errors and fix in Visual Studio
•      You should see the description updated and that the plugin ran
•      To see the plugin is registered in Dynamics 365, browse to the default
        solution to see the assembly registered under Plug-In Assemblies.
•      Under Sdk Message Processing Steps, the new step shows as registered
When the plugin runs as expected in the Dev environment, you are ready to create a solution to export to the QA or Prod environment.
Chinmay PatelChief Technology NinjaCommented:
Hi apoll07,

You are partially correct. The steps you have mentioned are good for registration and functional testing.
If you want to debug a plugin that is registered in Dynamics 365 Online, you must use Plugin Profiler.
You can find step by step instruction as well as the instruction for Disconnected/Remote/Offline debugging of the Plugins


PS: Please do not get confused with the page's title.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
apollo7Author Commented:
The Plugin Profiler is needed because the plugin is in Dynamics 365 Online.  It seems to be an extension to the PRT
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Chinmay PatelChief Technology NinjaCommented:
Yes it is an extension to PRT. And you can use it for On Premise installations also.
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:

If you want to go for unit testing of your plugin within Visual Studio. You can go for FakeXrmEasy framework. It provides you a fake Xrm context.

As far as you're working on simple plugin steps, you can unit test them. I do remember, it does not work with EntityMetadata.

Check this post for simple steps- https://community.dynamics.com/crm/b/dynamicscrmdevdownunder/archive/2016/11/21/plugin-integration-tests-using-fakexrmeasy

apollo7Author Commented:
One last question: can the code be debugged using Visual Studio if the Dev environment is not a duplicate of Production?  Or do I need the Dev server to include all the entities, solutions, etc. that are on the Production server?
Chinmay PatelChief Technology NinjaCommented:
That's the whole point of offline debugging. You won't need the Dev Environment at all. But then how would you really check the functionality of the Plugin? It has to be executed in an environment where all the necessary components are in place i.e. You should have the solutions installed.
apollo7Author Commented:
Thanks for the answers, very helpful
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Dynamics

From novice to tech pro — start learning today.