+ Start a Discussion

Test Users in Test Methods



I'm hoping there's a simple solution to the problem I'm running into. To write my tests so that they are  independent of any organization, I would like to create new test users in my test methods and then use RunAs to verify expected behavior as the different types of users. The problem I'm running into is that if an organization has maxed out their licenses I can't create the users for my tests. Is there anyway to get around this?


Thanks in advance for any help!



Best Answer chosen by Admin (Salesforce Developers) 
You could try creating your test users but make them "inactive" They should still work for your test - but since they're inactive it won't count against your organization's license cap.