You need to sign in to do that
Don't have an account?
Ravi_SFDC
How to find the exact test class for the APEX Trigger
Hi,
I do have a concern. How can we find the exact APEX Test Class for the respective APEX Ext Class and APEX Trigger.
Example: Someone in the org has written a APEX Trigger and now i need to change the code, i dodn't even know that whether that Trigger has a Test Class or not. How can i find the Test Class for the respective Trigger in the ORG. Your help would be really appreciated.
Thanks & Regards
Ravi.
To find out what covers a class, the easiest way is to launch the developer console (Select "Developer Console" from the drop down menu under Your Name in the top right)
From there, open the Apex Trigger class and in the top left, there is a drop down that sayd "Code Coverage: xx%"
Click that, and it will give you a breakdown of each class, and indeed each method, that is contributing to the coverage of that trigger.
To find test classes, go to developer console > ctrl+shift+o (open file) > enter *<objectname>*test.. if you are following best practices for class naming you shoul get the desired results.
e.g. for TaskTrigger try searching *task*test, you can run these test classes, after all test classes are run, go to tasktrigger and find code coverage contributors by clicking on 'code coverage: all tests' -- refer image above..