You need to sign in to do that
Don't have an account?
Starhunter
Setting URL parameters in test class
I am writing a test class where I have to set certain URL parameters. I want to toggle between various values of the same parameter in one test method. Is it possible. Or else I have to create separate test method for this purpose. Below is a snippet , where I want to set the param value to 'value2' in the same function.
static testmethod void demomethod(){
System.runAs(demoUser)
{
test.starttest();
ApexPages.currentPage().getParameters().put('param','value1');
DemoControllerExtension Ext = new DemoControllerExtension ();
test.stoptest();
}
}
static testmethod void demomethod(){
System.runAs(demoUser)
{
test.starttest();
ApexPages.currentPage().getParameters().put('param','value1');
DemoControllerExtension Ext = new DemoControllerExtension ();
test.stoptest();
}
}