You need to sign in to do that
Don't have an account?
Royal
test class code coverage line showd in red color ?
Hi,
I know test class how it will work in salesforce but i dont know why simple single with out any condition also lines are not covered ?
you can see first line is a simple line there is no any condition but it is showing red color why ?
n second if if conditon not sucess else should be execute right, but in red color why ?
how we can do execute this
I know test class how it will work in salesforce but i dont know why simple single with out any condition also lines are not covered ?
you can see first line is a simple line there is no any condition but it is showing red color why ?
n second if if conditon not sucess else should be execute right, but in red color why ?
how we can do execute this
Can you please send the Apex class which you want to covered
Obviously the code in red is not covered and there may be several reasons.
1. Have you checked your debug logs and trace the code execution?
2. Are there any exceptions that are preventing the code from being covered?
3. Try to look for "Attempt to de-reference a null value," "DML Exception,". etc. in your debug logs.
4. If the above code is enclosed in another if-statement that is covered, then you need to meet that criteria.
5. Like Chandra mentioned, you will also need two separate methods to cover both the if and else parts.