Skip to content

XWIKI-24807: AdministrationSectionPage#clickSave() doesn't wait for the page reload, causing flickering StaleElementReferenceException in administration UI tests - #6313

Merged
surli merged 1 commit into
masterfrom
XWIKI-24807
Sep 4, 2026
Merged

XWIKI-24807: AdministrationSectionPage#clickSave() doesn't wait for the page reload, causing flickering StaleElementReferenceException in administration UI tests#6313
surli merged 1 commit into
masterfrom
XWIKI-24807

Conversation

@surli

@surli surli commented Sep 4, 2026

Copy link
Copy Markdown
Member

Jira URL

https://jira.xwiki.org/browse/XWIKI-24807

Changes

Description

  • AdministrationSectionPage#clickSave(boolean) now waits for the full-page reload triggered by a
    non-async administration section's save button (using the existing
    addPageNotYetReloadedMarker()/waitUntilPageIsReloaded() idiom) instead of returning right after
    the click.

Clarifications

  • Root cause: XWikiWebDriver#findElement(By) resolves the element then calls scrollTo()
    (a separate executeScript() call). If the save's full-page reload tears down the DOM in the
    window between those two calls, the element reference goes stale and the next page-object call
    throws StaleElementReferenceException. This affects every non-async administration section, not
    just Presentation, since they all share this clickSave() code path.
  • Confirmed via Jenkins + Develocity that this is a genuine, recurring race (not a one-off infra
    fluke): the same failure, at the same line, recurs in isolation across independent builds with
    different Chrome/JDK combinations. See XWIKI-24807 for the full analysis.

Screenshots & Video

N/A — no UI change, this only affects test synchronization.

Executed Tests

  • mvn clean install -B -ntp -Plegacy -pl xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-pageobjects — green (Checkstyle, license, Spoon all pass).
  • Re-ran the whole PresentationIT docker IT class with showPageAttachmentsTab repeated 10 times,
    against Tomcat 11/jdk25 + PostgreSQL + Chrome (matching the failing CI job): 15/15 executions
    passed, BUILD SUCCESS.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • stable-18.4.x (PR opened separately)

🤖 Generated with Claude Code

…he page reload, causing flickering StaleElementReferenceException in administration UI tests

* clickSave(boolean) now synchronizes on the full-page reload triggered by a
  non-async section's save button, using the existing
  addPageNotYetReloadedMarker()/waitUntilPageIsReloaded() idiom, instead of
  returning immediately after the click
* this avoids a race where a caller reading back the saved value right after
  clickSave() can hit a stale element from the page being unloaded

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@surli
surli merged commit 0721f5c into master Sep 4, 2026
7 checks passed
@surli
surli deleted the XWIKI-24807 branch September 4, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant