+ Start a Discussion

Deploy Viualforce page with callout

When I run the test to deploy a visualforce page I get the following error :
System.TypeException: Testmethods do not support webservice callouts.
It's hard to believe than you can write some apex code and you can not deploy .
Anybody know how to get around that limitation?
get rid of the section of the test method that calls the webservice. you have to obtain code coverage elsewhere. If you can't get enough covered you can dummy up some lines to reach 75%

integer i = 0;
Ron HessRon Hess
What i find myself doing is breaking the code up so that the callout is the end or near end of a method. Then i do the processing in a separate method, which i can pass parameters into from a test perspective, this allows met to get coverage on the post callout code, as my test method can pass in a valid XML string such as i would expect from the callout.

it gets the coverage that i need without adding no-op statements.