You need to sign in to do that
Don't have an account?
Isaac Gomolka
Test if Visualforce Page will save in extension test class
Hi everyone. I was wondering if there is a way to test if a visualforce page will save correctly. I have a VF page with an extension class. I am making a test class for that extension class. I want to test to see if after I do smaller tests and input all the required info for the VF page if it will save correctly ( aka all the required fields r working correctly).
So basically is there a way to test if the save method works and a VF saves successfully?
In case you need it, here is my test class:
Thanks for your help in advanced!
So basically is there a way to test if the save method works and a VF saves successfully?
In case you need it, here is my test class:
@isTest public class EscalationPageExtensionTest { static testMethod void testMethod1() { Case cas = new Case(Status ='New', Priority = 'Medium', Origin = 'Email'); insert cas; Test.StartTest(); ApexPages.StandardController sc = new ApexPages.StandardController(cas); EscalationPageExtension testObj = new EscalationPageExtension(sc); testObj.picklist1 = 'true'; testObj.picklist2 = 'true'; testObj.picklist3 = 'true'; cas.Escalation_Users_Affected__c = '123'; cas.Escalation_Business_Functionality__c = 'Business Functionality I cant perform....'; testObj.setDataIntegrity(); System.assertEquals(cas.Escalation_Data_Integrity__c, true); testObj.setViableWorkaround(); System.assertEquals(cas.Escalation_Viable_Workaround__c, true); testObj.setAppFunction(); System.assertEquals(cas.Escalation_Application_Functionality__c, true); List<SelectOption> lstOptions = testObj.options; System.assert(lstOptions.size() > 0 ); sc.save(); //This is where I want to know if I can test saving the VF page Test.StopTest(); } }
Thanks for your help in advanced!
Let us kno wif this will help you
All Answers
Try to query field like below
testObj.setAppFunction();
Let us know if this will help you
Let us kno wif this will help you