There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-4508b8a2-81da-49ea-b533-669d8802f348 XWIKI-22178 Open

RealtimeWYSIWYGEditorIT#editWithSelf is flickering

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-b55a6e16-3698-4b24-bf3e-832759841d11 Marius Dumitru Florea on 15/May/26 14:18
 

Another stacktrace:

The element with the reference 014b0a9a-79cb-46a6-bd71-77f3b9fdaf05 is stale; either its node document is not the active document, or it is no longer connected to the DOM
For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#staleelementreferenceexception
Build info: version: '4.41.0', revision: '9fc754f'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.0-45-cloud-amd64', java.version: '21.0.11'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [c34a88ea-cfbf-4feb-a5d1-f73b2ad7986d, getElementDomAttribute {name=src, id=014b0a9a-79cb-46a6-bd71-77f3b9fdaf05}]
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 149.0.2, container:hostname: 0a4a8bd74054, moz:accessibilityChecks: false, moz:buildID: 20260403140140, moz:firefoxOptions: {prefs: {dom.disable_beforeunload: false, remote.active-protocols: 1, remote.events.async.enabled: false}}, moz:geckodriverVersion: 0.36.0, moz:headless: false, moz:platformVersion: 6.1.0-45-cloud-amd64, moz:processID: 174, moz:profile: /tmp/rust_mozprofileRicF2Z, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdpEnabled: false, se:containerName: 0a4a8bd74054, se:deleteSessionOnUi: true, se:downloadsEnabled: true, se:gridWebSocketUrl: ws://127.0.0.1:34265/sessio..., se:noVncPort: 7900, se:vnc: ws://172.17.0.5:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.17.0.5:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: {beforeUnload: ignore, default: ignore}, userAgent: Mozilla/5.0 (X11; Linux x86..., webSocketUrl: ws://172.17.0.5:4444/sessio...}
Element: [[[[RemoteWebDriver: firefox on linux (c34a88ea-cfbf-4feb-a5d1-f73b2ad7986d)] -> css selector: .realtime-edit-toolbar .realtime-user[data-id='dd0e8c18-1c7d-4b5f-83b3-6920f7ae83c3-c99b5344-3b54-4d3d-b73d-226cd5639810']]] -> class name: realtime-user-avatar]
Session ID: c34a88ea-cfbf-4feb-a5d1-f73b2ad7986d
org.openqa.selenium.StaleElementReferenceException: 
The element with the reference 014b0a9a-79cb-46a6-bd71-77f3b9fdaf05 is stale; either its node document is not the active document, or it is no longer connected to the DOM
For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#staleelementreferenceexception
Build info: version: '4.41.0', revision: '9fc754f'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.0-45-cloud-amd64', java.version: '21.0.11'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [c34a88ea-cfbf-4feb-a5d1-f73b2ad7986d, getElementDomAttribute {name=src, id=014b0a9a-79cb-46a6-bd71-77f3b9fdaf05}]
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 149.0.2, container:hostname: 0a4a8bd74054, moz:accessibilityChecks: false, moz:buildID: 20260403140140, moz:firefoxOptions: {prefs: {dom.disable_beforeunload: false, remote.active-protocols: 1, remote.events.async.enabled: false}}, moz:geckodriverVersion: 0.36.0, moz:headless: false, moz:platformVersion: 6.1.0-45-cloud-amd64, moz:processID: 174, moz:profile: /tmp/rust_mozprofileRicF2Z, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdpEnabled: false, se:containerName: 0a4a8bd74054, se:deleteSessionOnUi: true, se:downloadsEnabled: true, se:gridWebSocketUrl: ws://127.0.0.1:34265/sessio..., se:noVncPort: 7900, se:vnc: ws://172.17.0.5:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.17.0.5:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: {beforeUnload: ignore, default: ignore}, userAgent: Mozilla/5.0 (X11; Linux x86..., webSocketUrl: ws://172.17.0.5:4444/sessio...}
Element: [[[[RemoteWebDriver: firefox on linux (c34a88ea-cfbf-4feb-a5d1-f73b2ad7986d)] -> css selector: .realtime-edit-toolbar .realtime-user[data-id='dd0e8c18-1c7d-4b5f-83b3-6920f7ae83c3-c99b5344-3b54-4d3d-b73d-226cd5639810']]] -> class name: realtime-user-avatar]
Session ID: c34a88ea-cfbf-4feb-a5d1-f73b2ad7986d
	at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:169)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:142)
	at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:223)
	at org.openqa.selenium.remote.TracedCommandExecutor.execute(TracedCommandExecutor.java:53)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
	at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:223)
	at org.openqa.selenium.remote.RemoteWebElement.getDomAttribute(RemoteWebElement.java:144)
	at org.xwiki.realtime.test.po.CoeditorElement.getAvatarURL(CoeditorElement.java:93)
	at org.xwiki.realtime.wysiwyg.test.ui.RealtimeWYSIWYGEditorIT.editWithSelf(RealtimeWYSIWYGEditorIT.java:265)

The issue in this case is that the list of connected users is updated while the test is asserting the avatar URL. We can:

  • improve the test to re-try in case of StaleElementReferenceException
  • improve the code of the realtime toolbar to:
    • don't update the list of connected users unless there is an actual change (to be checked, it might already be the case)
    • don't re-render connected users for which there is no change

In the end the idea is to minimize DOM changes caused by realtime activity. Using a framework like Vue to generate the realtime toolbar might help as well (assuming they optimize the number of times a component is re-rendered, i.e. perform this only when necessary).