Hi,
I had the please working with Chanpreet Saluja this week with some Microsoft CRM testing, here are some of my notes in regards to setting up the CRM Performance Toolkit.
- Ensure the VSTestHost.exe.xml has the following setting:
<appSettings><add key=”urlkey” value=”crm://myserver:5555/”/></appSettings>
- Note port number is your CRM web site 🙂
Also, ensure this registry key exists:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM]
“ConfigSku”=”OnPremise”
“CRM_Perf_Toolkit_ConfigDir”=”C:\\CRM 4.0 Toolkit\\ConfigFiles\\”
“configdb”=”Application Name=CRM_Perf_BenchMark;Server=myserver;Initial Catalog=MSCRM_CONFIG;Integrated Security=sspi”
- The users created for test accounts in CRM must EXIST in the active directory PRIOR to running RunPopulation.cmd in the binaries folder.
- When you run RunPopulation.cmd, ensure you use a Domain Admin Account, that has access to CRM and AD etc. Access to the SQL Express Entity Manager Database is also important.
Here is a sample RunPopulation.cmd, this sample creates 1000 users in CRM and using a custom config file (unitTest_Custom.xml) for customized entities in CRM:
SET WEBSERVER=myserver:5555
SET ORGANIZATION=myorgnameNOSPACES
SET DOMAIN=mydomain
SET USERNAME=romikoderbynew
SET PASSWORD=password1
SET CRMUSERBASE=crmtestuser
SET CRMUSERSTART=1
SET CRMUSERCOUNT=1000
REM ImportCustomization\ImportCustomization.exe ImportCustomization\Account_Customized_10Attributes_form.xml /webserver:%WEBSERVER% /orgname:%ORGANIZATION% /domainname:%DOMAIN% /username:%USERNAME% /password:%PASSWORD% /authentication:AD
REM ImportCustomization\ImportCustomization.exe ImportCustomization\Contact_Customized_10Attributes_form.xml /webserver:%WEBSERVER% /orgname:%ORGANIZATION% /domainname:%DOMAIN% /username:%USERNAME% /password:%PASSWORD% /authentication:AD
REM ImportCustomization\ImportCustomization.exe ImportCustomization\Task_Customized_10Attributes_form.xml /webserver:%WEBSERVER% /orgname:%ORGANIZATION% /domainname:%DOMAIN% /username:%USERNAME% /password:%PASSWORD% /authentication:AD
DbPopulator\UserConfigGen.exe /domain:%DOMAIN% /webserver:%WEBSERVER% /userbase:%USERNAME% /password:%PASSWORD% /threadcount:1 /crmuserbase:%CRMUSERBASE% /crmuserstart:%CRMUSERSTART% /crmusercount:%CRMUSERCOUNT% /orgname:%ORGANIZATION%
DbPopulator\dbPopulator.exe UserPopulate.xml
DbPopulator\dbPopulator.exe c:\unitTest_Custom.xml
REM DbPopulator\dbPopulator.exe DbPopulator\ProductSuite.xml
REM DbPopulator\dbPopulator.exe DbPopulator\NestedSFAEntitiesWithState_Custom.xml
REM DbPopulator\dbPopulator.exe DbPopulator\ReportsData.xml
So, if you have any custom Tables you want to add to the database to represent your custom CRM entities, you will need to create an XML file, loads of samples are available at:
C:\CRM 4.0 Toolkit\CRM4_Perf_Toolkit\dbPopulator\Sample_Xmls
Once you have the XML in place, you will also need to update the EntityManager.cs file to add custom entries at these line numbers:
Line 49: public static class EntityNames
Line 430: public static string GetEntityIDName(string Type)
Line 494: private void TruncateTables()
Line 706 :private void LoadFromSQL() –
you need to create a corresponding custom method, use existing ones as examples! Note the difference between user and organization owned entities! Also use the Customize Entities feature in CRM to find attribute names e.g. Name, Title etc
Line 915: Create a BuildEntityFromSQL for the custom entity (note user or organization owned)
here is a sample method I created for the method call section at line number 706.
/// <summary>
/// Reads all defined Communications
/// </summary>
private void ReadCommunications()
{
string[] Props = { EntityIDNames.Organization, EntityIDNames.Communications, “rel_title” };
string EntityName = EntityNames.Communications;
string where = ” where deletionstatecode = 0 and statecode = 0 “;
Trace.WriteLine(“Read ” + ReadEntityFromTable(EntityName, Props, where) + ” rel_communication”);
}
note that some entities will not use statecode! so ensure the where clause you use matches the table definition in the EntityManager and MSCRM_CONFIG database!
Also, update the EMDB_Setup.sql script to create the custom tables in EntityManager.
The EntityManager database is the gateway for all testing, it is used to manage GUID’S when it needs to create/delete/update leads in test scenarios, as it servers as the lookup database 🙂
Once you got it all in place, you can run the EMDBLoader to load data from MSCRM_CONFIG to ENTITYManager, so make sure you FIRST dbpopulate and then afterwards check the error logs and then run EMDBLoader 🙂 EMDBLoader will call the entitymanager singleton instance and load the data for you.
If you run DBPopulator and then later want to update Entitymanager, just increment the count for this setting in the: C:\CRM 4.0 Toolkit\ConfigFiles\ConfigSettings.xml
<reloadentitymanager value=”17″/>
From the above you can see I reloaded it 17 times already 🙂
I hope this helps you all with your endeavours for using the CRM ToolKit.
Fiddler is a great tool to use to use as a reference when creating custom tests. You should use the framework in the toolkit, however, it is VERY time consuming to write custom tests, so do not underestimate it, as you will need to create various helper methods in the utils.cs and urls.cs files! As custom grids will need to be made which requires intricate CRM form knowledge which you can build up from Fiddler logs.
If you want to TEST SIMULATNIOUS CRM User connection, you must also add the following to ALL _PREWEBTEST methods in the .cs files for web tests:
user = EntityManager.Instance.GetNextUser();
e.WebTest.UserName = user[“domainname”];
e.WebTest.Password = user[“userpassword”];
- Browser caching can be disabled in the Utils.cs file, set this.PreAuthenticate = true;
Cheers
you are in reality a excellent webmaster. The site
loading velocity is incredible. It kind of feels that you are doing any distinctive trick.
In addition, The contents are masterwork. you’ve performed a excellent activity on this topic!
Hi Romiko,
I am getting few exception on running the webtests and loadtests. i researched a lot but not able to figure it. Can you please guide me.Exceptions that i am getting are :-
1. PreWebTest Event: Failed to find any entities for Request: Crm_Per_Benchmark_EntityRequest.
2. GUID should contain 32 digits with 4 dashes.
3. Index was out of range.Must be non-negative and less than the size of the collection.
4. The request failed with http status 401: Unauthorised.
5. The full version of Visual Studio Ultimate is required to run the load test with virtual user count greater than 25.
Please guide me…
Hi Romiko,
I have followed your post but after loading the webtests and loadtests, i am getting few exceptions. I researched a lot but not able find out the solution.Please guide me.
Exceptions that i am geeting are :-
1. PreWebTest Event: Failed to find any entities for Request: Crm_Per_Benchmark_EntityRequest.
2. GUID should contain 32 digits with 4 dashes.
3. Index was out of range.Must be non-negative and less than the size of the collection.
4. The request failed with http status 401: Unauthorised.
5. The full version of Visual Studio Ultimate is required to run the load test with virtual user count greater than 25.