You need to sign in to do that
Don't have an account?
Help to cover Page Reference in Test Class to increase Code Coverage
Hi All,
Below is my Apex Class for which i have got 72% Code coverage and want to make it to 75%.
Apex Class :
Out of the above lines only the below lines are not getting covered.Please Help...!
PageReference p = Page.ThankYou;
p.setRedirect(true);
return p;
Thanks for any help in Advance...!
Below is my Apex Class for which i have got 72% Code coverage and want to make it to 75%.
Apex Class :
public class myWeb2LeadExtension { private final Lead weblead; public myWeb2LeadExtension(ApexPages.StandardController stdController) { weblead = (Lead)stdController.getRecord(); } public PageReference saveLead() { try { insert(weblead); } catch(System.DMLException e) { ApexPages.addMessages(e); return null; } PageReference p = Page.ThankYou; p.setRedirect(true); return p; } }
Out of the above lines only the below lines are not getting covered.Please Help...!
PageReference p = Page.ThankYou;
p.setRedirect(true);
return p;
Thanks for any help in Advance...!
You can add Below Code Copy past in your org . it's working is my org getting 100% code coverage .
Regards ,
Harish.R
All Answers
Can you provide your test class . i can help you .
Regards ,
Harish.R
You can add Below Code Copy past in your org . it's working is my org getting 100% code coverage .
Regards ,
Harish.R
This is my Test Utility Class :
You want test class for below class or other class .
for this class you can add below test class it will get 100 % code coverage
Regards ,
Harish.R
@Harish rao 25 : Your solution worked for me.