Selenium is a powerful tool to automate user interactions on a browser. A robust Selenium framework with the right design can increase test coverage and save time. This is why many organizations use Selenium for automating their application testing, including Salesforce application.
You may also want to automate your Salesforce application testing with Selenium. Especially when manual testing alone can’t cover your testing requirements for regression testing. But applications built on Salesforce are pretty complex and can be challenging to test with Selenium. Here are the top three testing challenges with Selenium scripting, particular to Salesforce test automation.
1. Navigating through frames
Salesforce is a complex application with the front-end built with dynamic frames, that are able to load content independently in the current HTML document. Handling frames is difficult with Selenium as it cannot access the content directly. Normally you would require to switch the Selenium WebDriver to the frame using an attribute like
driver.switchTo().frame(“frame-attribute”); and perform actions within it. Any action that has to be performed outside this frame requires giving explicit instructions to Selenium to move out of that frame like driver.switchTo().parentFrame(); or driver.switchTo().defaultContent(); on a web page.
Frames can be handled by Selenium albeit it takes a lot of effort in finding the right attributes and script accordingly. It becomes more tedious when you deal with nested or hidden frames. As the application can have many frames, a usual 30-50 step test case can take hours of coding and usually results in a brittle script.
2. Executing against dynamic content
Like most modern web application, Salesforce has dynamic elements which do not have a fixed ID, name, class or CSS attributes. So, you cannot hard code the locator of the element. A standard method to detect the fixed part of the locator is not usually straightforward. Minor UI changes can make the tests flaky. Besides, Selenium could get into synchronization issues with element loading. And as most elements load dynamically, the test script needs to add Implicit, Explicit or Fluent Waits.
3. Handling tables
Salesforce application can have a different database driven tables. The rows are created dynamically and could be controlled by different tabs. So, simple actions like ticking a checkbox with Selenium can be quite complicated and prone to errors. Selecting the active tab may be challenging. Commands such as driver.switch_to.window and send_keys may not work reliably.
Salesforce applications can have complexities like Shadow DOM and pop-up windows that are not easy to test with Selenium. Selenium doesn’t support such elements directly, hence requiring significant custom coding. The challenges such as test case maintenance is present with testing any complex application.
Though most of the challenges of testing Salesforce with Selenium can be solved, scripting ends up consuming a lot of time. This can impact your continuous testing goals.
accelQ is a codeless test automation platform that allows testers to generate test cases for Salesforce with ease. It a cloud-based platform and enhances the power of Selenium making it reliable, scalable and cost-effective.
With accelQ you can overcome the challenges mentioned above without the need for programming. Learn more about our Salesforce test automation solution.