Katalon Studio and Microsoft Dynamics 365

For those of you struggling with using Katalon to run automated tests against Microsoft Dynamics CRM, we have successfully created keywords using code from GitHub - 13rice/EasyRepro-Katalon: EasyRepro conversion to Groovy for use in Katalon Studio.

Dynamics 365 creates a hierarchical html structure around every Dynamics field. To correctly interact with their elements, you need to find the parent element of the Katalon recorded test object to interact with, then use the EasyRepro-Katalon methods to interact with it.

We did this by modifying the existing methods and creating our own wrapper methods to find these parent elements and interact with them with one method call.

This is based on the C# EasyRepro which Microsoft provided to resolve these same issues in C#.

We are in the midst of cleaning up our modifications and extensions to the EasyRepro-Katalon and hope to publish them as a plugin soon.

6 Likes

@danpoleary Well done :+1:

Can you advise what version of Dynamics this works with and what interface please? Eg Classic, UCI?
Great work by the way :slight_smile:

Hi @Dan_Bown, We have heavily modified the code from that Github project so that it works on both the Classic and UCI views. We have also run it against Dynamics 365 from 8.2 to 9.1. We are testing against 10 now.

We regularly update our keywords with updates from https://github.com/microsoft/EasyRepro.

Thanks a lot, that’s good to know, will give it a try at some point.
Could I also ask whether you know about the ‘testmode’ flag please?
I gather from EasyRepro issues log that setting this to ‘true’ will cause all elements to load. Currently, our application uses lazy loading which means automated scripts have ensure that elements are on screen at the time - adds complexity.
The code appears to be this:

    internal BrowserCommandResult<bool> InitializeTestMode()
    {
        return this.Execute(GetOptions("Initialize Unified Interface TestMode"), driver =>
        {
            var uri = driver.Url;
            var queryParams = "&flags=testmode=true";

            if (!uri.Contains(queryParams))
            {
                var testModeUri = uri + queryParams;

                driver.Navigate().GoToUrl(testModeUri);

                driver.WaitForPageToLoad();
                driver.WaitForTransaction();
            }

            return true;
        });
    }

Is it possible to use the same testmode outside of the C# EasyRepro project? I was hoping that simply appending ‘&flags=testmode=true’ to the url would cause all elements to load at once. I have a query on GitHub from August last year asking the same question but no response sadly. Many thanks, Dan

I have not used the testmode flag. We just make sure our tests behave in the same way a user would interact. When they do something that loads more, we wait till the load is complete and then continue. The testmode flag can allow tests to pass that would fail in real world where an action fails to load other elements. We have had this happen where certain conditions must be met to load more elements, but for some reason it would fail. You would not catch these with testmode.

You can still use testmode, since it is just a parameter to the URL for your application.

Thanks, and yes, I get your point about aiming to emulate real-life conditions.
I don’t see any difference if I change the URL to include the flag, perhaps there is something else going on. Potentially it would be useful to quickly verify that custom controls appear correctly - but only if testmode completely replicates real use!

Did you try also setting easyreproautomation=true in the url?

&flags=easyreproautomation=true,testmode=true

hi…
it was really good advise for microsoft dynmaics 365.thank you

Hi - sorry for delay in replying, have now got another Dynamics licence so able to verify testmode flag… tried appending the complete string this time, &flags=easyreproautomation=true,testmode=true.
Still the same result though - the page continues to use lazy loading.
We’ll continue with the existing strategy though but I’m keen to see custom keywords :slight_smile:
Cheers Dan

Hi @danpoleary
wondered whether you had an idea of timescales for this plugin please?
Regards
Dan

Sorry @Dan_Bown , have been very busy.

To re-wrap them will take some time. I am deep in automation testing builds right now, and once we are between releases, I will get back on it.

Dan

No problem Dan, cheers for the update

This sounds like what I need, did this get released as a plugin?
Thanks

It has not been released as a plugin yet. I have not had time due to current workload. It has now been updated to support both classic and Unified Interface.