Top 3 challenges in testing Salesforce applications with Selenium

Page 1

Top 3 Challenges In Testing Salesforce Applications With Selenium 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.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.