While Salesforce runs thousands of its own UI tests, Visualforce developers still need to test their own code, as well as web applications that integration with our Force.com applications.

Selenium Page Flow

As a best practice, custom Visualforce controllers should be covered by Apex unit tests, and the Visualforce pages by UI integration tests as well. For UI integration test, Selenium is an excellent choice: It’s well adopted in the industry and has a low learning curve. Even so, architected incorrectly, Selenium tests can be hard to maintain and costly to develop.

In the session “Streamline Selenium Testing with Page Flow Navigation” (Dreamforce 2013), Ted Husted and Derek Hansen present a robust architecture that makes UI integrations tests easier to create and maintain.

For more, visit the session’s Git repository repository.

Test Automation

In the session “Test Automation With Cucumber JVM, Selenium, and Mocha“ (Dreamforce 2013) Sanjay Gidwani and Shuji Ui overview behavior-driven development and test automation, using Cucumber JVM, Selenium, Jenkins, and Git, in a real-world environment. During the production of a Visualforce/JavaScript application for an enterprise client, the team was able to catch regression errors during development thanks to this approach.

Return to Best Practices for Enterprise Development on Force.com