I have created a outbound changeset from test to production. After uploading to production i validated the package in production. It failed for one test class. I tried running that test class individually in test and production and it passed but when i run it in package it is failing.

  • Can you share test class and error which you are facing?
    – Peeyush
    Feb 17 '16 at 9:43
  • Your validations are returning null from the saveRfp() method.
    – ajinkyah
    Feb 17 '16 at 9:50
  • What happens if you run all of the same tests in your sandbox as a group? Do you get the same error?
    – smckitrick
    Feb 17 '16 at 13:39

This can have multiple causes. If the test class runs fine at the moment, but not if you include your other changed resources, these other resources are doing something that effects the outcome of this test class. For example, if you assert for a deactivated User, but one of the other modified classes or triggers prevents a user from being deactivated, your test class will now fail.

To further investigate this, please provide some example code.

  • I have updated the above
    – hellraizer
    Feb 17 '16 at 9:48

Null value returned from the method saveRfp() and your test method set the null value as current page which causes the issue.

when you call the method saveRfp() from your test class, the two validation methods isFormValid() and saveData() should get passed.

If error received only during deployment,please check if any errors when you run all test classes in sandbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.