Salesforce Automation Challenges – Request for Guidance

9 views
Skip to first unread message

Saravanan G

unread,
Dec 31, 2025, 9:18:04 AM (16 hours ago) 12/31/25
to Selenium Users
Hello Everyone, 

Can you please help on this.

Issue Description
We are facing major instability and intermittent failures in our Salesforce Lightning UI automation using Selenium WebDriver with Java. The issue is impacting regression reliability and CI stability.

Despite having stable test data and valid credentials, the same test scenarios behave inconsistently across executions, including failures in single-scenario runs.

Key Challenges Observed

Timeout & Synchronization Issues
  •  Frequent TimeoutExceptions during:
  •  Page load
  •  Element visibility
  •  Click actions
  •  Explicit waits are already implemented, but Salesforce Lightning performs background DOM refreshes, causing elements to become stale or unresponsive.

Element Click Intercepted & Dynamic UI Behavior
  •  ElementClickInterceptedException occurs due to:
  •  Lightning spinners
  •  Overlays
  •  Modals appearing/disappearing dynamically
  •  Even when elements are visible, clicks fail due to hidden UI layers.
  •  Locators become invalid because Salesforce re-renders components instead of refreshing the page.

Salesforce MFA Automation Challenges
  •  MFA prompts appear randomly during execution.
  •  In some runs:
  •  Verification code is not triggered
  •  MFA page is skipped
  •  This blocks automation and causes false failures.
  •  Unable to achieve deterministic login behavior across executions.

Incorrect Username / Password Errors (Intermittent)
  •  Salesforce occasionally throws invalid login errors, even though:
  •  Credentials are correct
  •  Same credentials work manually

Partial Page Load / White Screen Issue
  •  In some executions:
  •  Only Salesforce page headers load
     •  The main UI remains blank (white screen)
     •  Selenium continues execution assuming page load is complete.
        •  Leads to cascading failures due to missing elements.
        •  No clear signal from WebDriver that Lightning UI failed to load fully.


Highly Inconsistent Test Execution Results
  •  Test results change between runs without any code changes.

Example
:
  •  Execution 1: Run scenarios 1, 2, 3
  •  Scenario 1 - Pass
  •  Scenario 2 - Fail
  •  Scenario 3 - Pass

  •  Execution 2: Run scenarios 2, 3, 4
  •  Scenario 2 - Pass (failed earlier)
  •  Scenario 3 - Fail
  •  Scenario 4 - Fail

  •  Even single-scenario execution:
  •  Fails intermittently
  •  Passes only after multiple retries

Environment Details
  •  Platform: Salesforce Lightning Experience
  •  Automation Tool: Selenium WebDriver
  •  Language: Java
  •  Framework: POM with Cucumber & TestNG
        •  Locators Identfied using - CSS, Dynamic (Preceding, following, siblings, and                                                                         Ancestors) and Relative Xpaths
     •  Browser: Chrome (latest)
  •  Execution Mode: Local & CI pipelines
  •  Authentication: Username/Password + MFA

It would be great to support on this.





Best Regards,
Saravanan Gopinadhan


venkatesh iyengar

unread,
Dec 31, 2025, 5:21:32 PM (8 hours ago) 12/31/25
to seleniu...@googlegroups.com
Happy New Year Saravanan,

Please find below some of the checklist you can try for the challenges above : 

    Synchronization: Add LightningWaits and call waitForGlobalIdle() before/after actions.
  • Locators: Switch to data-test/ARIA-driven CSS; stop using deep relative XPaths.
  • Clicks: Implement safeClick with interceptor checks and JS fallback.
  • Login: Prefer frontdoor with session id (OAuth/SSO). Add trusted IPs to suppress MFA for CI.
  • Readiness: Add white screen guard and fail fast with controlled refresh.
  • CI hardening: Tune Chrome options, add limited retries, create data via API, and collect artifacts.
  • Let me know if you have any questions 

  • Regards,
  • Venkatesh

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/selenium-users/07b8912a-b341-44c2-a035-fb29c9b50f4an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages