+ Start a Discussion
Kirill YunussovKirill Yunussov 

Test class does not run in UI, but completes in IDE - what is its true coverage?

Some test classes you cannot run through UI, but can through IDE.   How do such test classes affect the total code coverage percentage for the org?   Are they seen as having 0% coverage, or whatever the IDE says they cover (95% for example)?


 MIXED_DML_OPERATION, DML operation on setup object is not permitted Error

in the UI with the new release its not showing code coverage this is an issue and SFDC is working on it. However, if you see MIXED_DML_OPERATION then you will have to fix your test class. Eclipse ide doen not detect this error.

Just use runAs in your test method , this will fix the issue.

Once there are no errors then you can refer to eclipse or console for actual code coverage.

1. It existing differnece between code coverage calcuator of Saleforce UI and IDE plug in. UI  should be considered correctly.

2. MIXED_DML_OPERATION error is coming as you are trying to insert setup and non setup objects in single flow.

Subhani PSubhani P

+ Sandeep suggestion,


A "setup" object is one that must be edited from the setup or builder area of the platform. These object include the User object, Ogranization object, Email templates and so on.

See this article for details DML operations of a non-setup sObject and a setup sObject




Salesforce Certified Developer,