Some people's say, I have wrote test classes but not getting code coverage. In this occasion, try the below steps. It might solve your problem.
Step 1:
Ensure your test class declared with correct annotation,
1. Test class should start with @isTest annotation.
2. Methods should declared as testMethod or @isTest annotation.
Go to Setup --> Build --> Develop --> Apex Test Execution --> Options --> Disable Parallel Apex Testing
Ensure "Disable Parallel Apex Testing" check box is checked.
Note: Try the below solution if you received an error as "UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record"
Step 3:
Step 1:
Ensure your test class declared with correct annotation,
1. Test class should start with @isTest annotation.
2. Methods should declared as testMethod or @isTest annotation.
- @isTest
- private class MyTestClass {
- // Methods for testing
- static testMethod void test1() {
- // Implement test code
- }
- @isTest static void test2() {
- // Implement test code
- }
- }
Step 2:
Ensure "Disable Parallel Apex Testing" check box is checked.
Note: Try the below solution if you received an error as "UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record"
Step 3:
Go to Setup --> Build --> Develop --> Apex Test Execution --> View Test History--> Clear all data
Step 4:
Go to Setup --> Build --> Develop --> Apex Test Execution --> Select Test --> Run
No comments:
Post a Comment