You need to sign in to do that
Don't have an account?
Test Class working fine in prod but not in sandbox anymore
Hi,
I deployed an app into prod before couple of months and all the test classes were fine with no errors with 75% coverage. Today i tried to run a test in my sandbox and a lot of errors were thrown with test % coming down to 48. So, i deployed test classes from prod to the sandbox and tried again, the result is same. Why is this happening though when i run the same test class in prod it has no errors with 75% where as in sandbox a lot of errors are thrown with 48% . Does any body know what is causing the problem or why such problem persists. FYI, my sandbox is not yet been upgraded to summer release and prod too not yet upgraded to summer release.
Thanks.
I too have had this issue. Here's a list of things I go through each time something like this happens 99.99% of time it's because I missed something in my test class.
Normally those 3 items plus the error messages from the test will help me figure out what's going on. Typically, if it's something from Production that is just now failing those three items are it. Other issues I've run into tend to be issues with Sandbox going to Production:
I hope this helps. If you need more guidance, I recommend pasting your test code here as well as your error messages.
All Answers
I too have had this issue. Here's a list of things I go through each time something like this happens 99.99% of time it's because I missed something in my test class.
Normally those 3 items plus the error messages from the test will help me figure out what's going on. Typically, if it's something from Production that is just now failing those three items are it. Other issues I've run into tend to be issues with Sandbox going to Production:
I hope this helps. If you need more guidance, I recommend pasting your test code here as well as your error messages.
In addition to the advice above, I'd make a special check of all the if conditions as if an environmental change has been made you may be skipping 20 lines of code because an if clause which previously validated to true now validates to false.
Hi,
Thanks for the reply, i was able to fix the failures. I missed out an IF condition and it was causing some failures and a custom field's lenght was creating some failures. After i included the missing IF condition and increased the lenght of my Custom Field text type, everything works fine, though the test % has come down a lot. Got to work on Test Classes again, which i hate doing it.
Thanks.