mercredi 6 avril 2016

Salesforce Custom button PageReference Testing

I have created a custom button to redirect to a Account edit page with auto populating some fields. I have used Custom Labels to set the Id's of fields.

I want to write a test class to check if all the Custom labels related to the custom button have been updated correctly.

For example: I have created a 'New Custom Account' Button. When clicked on it, it redirects to new Account edit page and autopopulate Name and Status__c. I have updated the ID's of Name and Status fields to Custom labels, so I dont need to hardcode them in Custom button. Now I want to write a test class to imitate the functionality of Custom button and then save the record, now assert the results with provided values, so that I can be sure that Name and Status__c fields are updated accordingly.

Please respond with any ideas.

Aucun commentaire:

Enregistrer un commentaire