You need to sign in to do that
Don't have an account?
Yassine Zouag
Test class - how to simulate a radio button selection ?
Hello,
In my VisualForce page, in order to be able to search by name or phone, I used selectRadio tag to only dispaly the name field or the phone field using : "rendered="{!searchBy=='phone'}" for example.
I tried :
Any ideas ?
Thanks
In my VisualForce page, in order to be able to search by name or phone, I used selectRadio tag to only dispaly the name field or the phone field using : "rendered="{!searchBy=='phone'}" for example.
<apex:selectRadio value="{!searchBy}" id="searchBy" onclick="searchByClick();"> <apex:selectOption itemValue="name" itemLabel="Search by Name" /> <apex:selectOption itemValue="phone" itemLabel="Search by Phone" /> </apex:selectRadio>In the test method, how to simulate click on the radio button ?
I tried :
myVisualForceController.getParameters().put('searchBy','phone');But it doesn't work.
Any ideas ?
Thanks
So in this case you'd instantiate the controller and then set the 'searchBy' property to 'name' or 'phone', then execute your action method.