This is first post of multi-series article on using Selenium with Salesforce for Automation testing. Testing has always been integral part of any software development life cycle and Salesforce has already taken it to next level by making mandatory to have 75% of code coverage before any code deployment. These apex test classes, however has its limitations where we can only test Apex code written. I have seen most of Salesforce project ending with manual testing. Audience for this series is not only developer but Salesforce admin and of course manual testers as well and please feel free to drop comment throughout this series if I left any area or topic uncleared.
What is Selenium
Selenium is a portable software testing framework for web applications. Selenium provides a record/playback tool for authoring tests without learning a test scripting language (Selenium IDE). It also provides a test domain-specific language (Selenese)[1] to write tests in a number of popular programming languages, including Java, C#, Groovy, Perl, PHP, Python and Ruby. The tests can then be run against most modern web browsers like firefox, Chrome, Internet explorer. Selenium deploys on Windows, Linux and Macintosh platforms.

How Selenium can benefit me
Its not only Automation testing where you can leverage selenium. You can use this tool to move some manual changes from one Salesforce organization to another, to avoid preparing test data every time when sand box is refreshed and so on.. usability is endless.
Installing Selenium
- Download and install Firefox browser
- Add Selenium IDE Plugin for Firefox from official Selenium download website
Once Selenium plugin is installed in Firefox we can launch Selenium IDE and it will look like below screen

As you can see in above image, red circle icon is used to record step and once it is recorded, can be re-run using green symbol. Complete step are explained in Video tutorial.
Error : Selenium element not found
Chances are very high, where we will receive error in selenium script about “Element not found”. This is because if some content is loaded via Ajax, Selenium doesnt know that it needs to wait. There are many ways to handle it, but for me “waitForElementPresent” works in most cases.
Selenium Test Case code snippet

Video Tutorial
Hi, we are planning to automate our salesforce UI testing with selenium. So I need you assistence
great article. thanks. Selenium+Salesforce!
Great post
Very Helpful article..
Hi, How to handle dynamically changing web elements of standard objects for Salesforce UI automation. Thanks.
Very Very helpful videos We are planning to automate some functionality in salesforce. Could you please upload videos of automate salesforce basics functionalities. . It would be a great help!! Thanks for sharing your knowledge.
Hello, what is your experience with Spring 17 release and using selenium to test pages where aura components are rendered. The elements rendered are not available to the webdriver like other elements
Hello,
Thank you for the post, I found the video is very useful. I would have a question if you encountered the issue with verification code ? I am using Robot Framework that is using Selenium to open new browser window and login to Salesforce. I manage to successfully login to Salesforce but my test script stops because of the Verification screen. One of my guess was that the cache of the browser was cleaned up before opening a new browser window. I would appreciate any help.
Nice informative article about selenium and Saleforce.Selenium is growing more nowadays.
Great blog. The information you provided in this blog regarding salesforce automation testing was great. Keep updating this.
Selenium Webdriver Course
Thanks for sharing such a knowledgeable blog on test automation. To know more on Enterprie software testing with regards to SAP Automation refer the following blog SAP Test Automation