3

I am working on Salesforce Lightning UI test automation using Selenium. While locating the elements, need to frequently open the Developer Tools section of Chrome/Edge and search for the locators (Preparing Dynamic locators).

But, while Developer Tools is open, Salesforce Lightning UI freezes/hangs for couple of minute or so for every DOM traverse/search.

Salesforce Lightning application navigation or functionality works fine if the Developer Tools is off, also Selenium test execution works fine.

Steps to reproduce:

  • Open Chrome/Edge Developer tools section (SHIFT+CTRL+I)
  • On Salesforce lightening UI, right click on an element and Inspect
  • Navigate to the elements sections in Developer Tools
  • Expand the DOM structure for the element or again Inspect the same/different element.
  • Do this for once/twice and you can see screen freezes for a while

Looking for any tips or suggestions on this behavior as its slowing down object identification and locators finding and entire automation process.

Note: I have raised the same issue at: https://developer.salesforce.com/forums/ForumsMain?id=9062I000000UekyQAC

1 Answer 1

2

While this does not answer for why your browser freezes, something I recommend is to move away from using DOM based model and instead use Page based Objects.

As a web application, such as Salesforce, changes from release to release, so does the DOM of the pages and components in the app. It is much less effort to update the UTAM page object for each changed component than it is to rewrite complicated UI automation tests. Using UTAM page objects reduces the testing time and pain every time an application UI changes.

Look into the UTAM to learn how to write end to end tests.

Specifically see how to generate page objects for Salesforce using the UTAM.

1
  • Thanks Mohith. This was in my task list, looking for some examples on how its integrated with Selenium.
    – Akshay J
    Jul 11, 2022 at 12:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .