function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
StarhunterStarhunter 

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();
        }
}