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
waitForGlobalIdle() before/after actions.
data-test/ARIA-driven CSS; stop using deep relative XPaths.safeClick with interceptor checks and JS fallback.--
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.