You need to sign in to do that
Don't have an account?
Getting view state error when running all unit tests
When I try to run all the unit tests via the 'Run All Tests' button found in Develop->Apex Classes, I have started getting the following message:
Maximum view state size limit (128K) exceeded. Actual viewstate size for this page was 150.625K
We have a pretty large ORG set up, so I'm sure it's because the system log has simply gotten too huge. When we run all the unit tests by using the Eclipse IDE, the tests complete just fine, except we don't get a snapshot of the overall code coverage. We just get code coverage on a class by class basis.
We want to be able to see where our overall code coverage is at. Is there any other way to do this other than through the web interface? Or, is there any way to make the unit tests less verbose through the web interface to reduce the size of the view state?
It doesn't look like there is a good easy solution to this, so I made a little .NET application using the Apex web API to run the tests using the 'runTests' method. From the test results I was able to figure out my code coverage by doing some quick math on the CodeCoverageResult.numLocations and CodeCoverageResult.numLocationsNotCovered methods.
I didn't post the code because it is pretty messy, but if anyone has specific questions I'd be happy to help out and share code.
All Answers
gm_sfdc_powerde, that works when code coverage is less than 75%. But when code coverage is above 75%, then the 'General Warnings' are not displayed. In our case, our code coverage is above 75%, so I cannot see the overall code coverage.
It doesn't look like there is a good easy solution to this, so I made a little .NET application using the Apex web API to run the tests using the 'runTests' method. From the test results I was able to figure out my code coverage by doing some quick math on the CodeCoverageResult.numLocations and CodeCoverageResult.numLocationsNotCovered methods.
I didn't post the code because it is pretty messy, but if anyone has specific questions I'd be happy to help out and share code.