You need to sign in to do that
Don't have an account?
Sri Hari 45
how to create dummy test data in visualforce page..?
Hi..,
I have a apex class in that i'm getting session form visualforce page, for that class i should have to write a test class
I'm using the pagereference ad it's covering the my class 61%..
So could you please how to create a dummy test data for a visualforce page in Test class..
Thanks..,
Sri Hari
Hello sri hari 45,
I think your focus should to cover the Apex code not for the VF page, still I am sharing some code please check it:
I hope this is helful for you.
Still you are getting difficulties please, share your problems.
Thanks,
Satish.
I have class but here in this getContent(), it's not covering my testclass
global static String getSessionIdFromVFPage(PageReference visualforcePage){
String content = visualforcePage.getContent().toString();
Map<String,Object> sessionJSON = (Map<String, Object>) JSON.deserializeUntyped(content);
String sessionID = String.valueOf(sessionJSON.get('sessionId'));
}
So could you please how to cover that content line in my test class..
Thanks
Hi sri Hari 45,
Its easy to cover the code,
please follow the below steps:
If this code help you than choose it as best answer,
still if you are getting error than let me know, I am ready to help you.
Thanks,
Satish.