-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.21.0
Node.js Version
20.11.1
Mode
Standalone Mode
Which capabilities are you using?
What happened?
In BiDi mode, when we try to close the modal and wait for the modal element not to be displayed anymore, getCSSProperty in isDisplayed function triggers implicit wait and attempts to re-locate the element that is no longer attached to the DOM until it times out.
What is your expected behavior?
Once the element is no longer attached to the DOM waitForDisplayed({reverse:true}) command should register the element as not displayed.
How to reproduce the bug.
Clone
git clone https://github.com/ivanovicu/wdio_issue.git
cd wdio_issue
Install
pnpm install
Run test
pnpm test
Relevant log output
2025-12-15T15:33:01.256Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"css","value":"[alt=\"WebdriverIO AI Copilot\"]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:01.931Z INFO webdriverio:PolyfillManager: Adding polyfill script to context with id C92BB4E203A46AF45D724843247816FE
2025-12-15T15:33:01.933Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[443 bytes] webdriverioPolyfill>","target":{"children":null,"clientWindow":"78203895","context":"C92BB4E203A46AF45D724843247816FE","originalOpener":null,"parent":"FBA9A96CC7589D092CE6EBBCB387044B","url":"about:blank","userContext":"default"},"awaitPromise":false}
2025-12-15T15:33:01.963Z INFO webdriver: BIDI RESULT {"id":11,"result":{"realm":"6790945810316314783.-5003126553839076147","result":{"type":"undefined"},"type":"success"},"type":"success"}
2025-12-15T15:33:02.692Z INFO webdriver: BIDI RESULT {"error":"no such frame","id":14,"message":"Context C92BB4E203A46AF45D724843247816FE not found","type":"error"}
2025-12-15T15:33:02.692Z INFO webdriver: BIDI RESULT {"id":13,"result":{"nodes":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.49","type":"node","value":{"attributes":{"alt":"WebdriverIO AI Copilot","src":"/img/materials/robot-white.svg","width":"40px"},"childNodeCount":0,"localName":"img","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
2025-12-15T15:33:02.697Z INFO webdriver: COMMAND elementClick("f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.49")
2025-12-15T15:33:02.697Z INFO webdriver: [POST] http://localhost:57514/session/e28fc7b27d16eb11c7a1b6e1161a1b11/element/f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.49/click
2025-12-15T15:33:02.698Z INFO webdriver: DATA {}
2025-12-15T15:33:02.796Z INFO webdriver: RESULT null
2025-12-15T15:33:02.798Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:02.873Z INFO webdriver: BIDI RESULT {"id":15,"result":{"nodes":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53","type":"node","value":{"attributes":{"class":"main-module_ms-main-bot__QKkRf ms-global ms-relative ms-w-full ms-px-4 ms-py-2"},"childNodeCount":3,"localName":"div","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}},{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.54","type":"node","value":{"attributes":{"class":"main-module_ms-main-bot__QKkRf ms-global ms-z-[100] ms-h-full ms-max-h-[550px] ms-w-full ms-overflow-y-auto ms-rounded-t-md","style":"color: rgb(255, 255, 255);"},"childNodeCount":5,"localName":"div","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
2025-12-15T15:33:02.879Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[279 bytes] checkVisibility>","awaitPromise":true,"arguments":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53"},{"type":"object","value":[["withinViewport",{"type":"boolean","value":false}],["contentVisibilityAuto",{"type":"boolean","value":true}],["opacityProperty",{"type":"boolean","value":true}],["visibilityProperty",{"type":"boolean","value":true}]]}],"target":{"context":"630EC351DF3F378C19BC6353D5447A15"}}
2025-12-15T15:33:02.879Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[423 bytes] anonymous>","awaitPromise":true,"arguments":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53"},{"type":"string","value":"display"}],"target":{"context":"630EC351DF3F378C19BC6353D5447A15"}}
2025-12-15T15:33:03.000Z INFO webdriver: BIDI RESULT {"id":16,"result":{"realm":"3219684284296112065.-5965027431538412822","result":{"type":"boolean","value":true},"type":"success"},"type":"success"}
2025-12-15T15:33:03.000Z INFO webdriver: BIDI RESULT {"id":17,"result":{"realm":"3219684284296112065.-5965027431538412822","result":{"type":"string","value":"block"},"type":"success"},"type":"success"}
2025-12-15T15:33:03.006Z INFO webdriver: COMMAND performActions(<object>)
2025-12-15T15:33:03.006Z INFO webdriver: [POST] http://localhost:57514/session/e28fc7b27d16eb11c7a1b6e1161a1b11/actions
2025-12-15T15:33:03.006Z INFO webdriver: DATA {"actions":[{"id":"action1","type":"key","parameters":{},"actions":[{"type":"keyDown","value":""},{"type":"pause","duration":10},{"type":"keyUp","value":""}]}]}
2025-12-15T15:33:03.029Z INFO webdriver: RESULT null
2025-12-15T15:33:03.030Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:03.059Z INFO webdriver: BIDI RESULT {"id":18,"result":{"nodes":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53","type":"node","value":{"attributes":{"class":"main-module_ms-main-bot__QKkRf ms-global ms-relative ms-w-full ms-px-4 ms-py-2"},"childNodeCount":3,"localName":"div","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}},{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.54","type":"node","value":{"attributes":{"class":"main-module_ms-main-bot__QKkRf ms-global ms-z-[100] ms-h-full ms-max-h-[550px] ms-w-full ms-overflow-y-auto ms-rounded-t-md","style":"color: rgb(255, 255, 255);"},"childNodeCount":5,"localName":"div","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
2025-12-15T15:33:03.061Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[279 bytes] checkVisibility>","awaitPromise":true,"arguments":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53"},{"type":"object","value":[["withinViewport",{"type":"boolean","value":false}],["contentVisibilityAuto",{"type":"boolean","value":true}],["opacityProperty",{"type":"boolean","value":true}],["visibilityProperty",{"type":"boolean","value":true}]]}],"target":{"context":"630EC351DF3F378C19BC6353D5447A15"}}
2025-12-15T15:33:03.061Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[423 bytes] anonymous>","awaitPromise":true,"arguments":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53"},{"type":"string","value":"display"}],"target":{"context":"630EC351DF3F378C19BC6353D5447A15"}}
2025-12-15T15:33:03.158Z INFO webdriver: BIDI RESULT {"id":19,"result":{"realm":"3219684284296112065.-5965027431538412822","result":{"type":"boolean","value":true},"type":"success"},"type":"success"}
2025-12-15T15:33:03.159Z INFO webdriver: BIDI RESULT {"id":20,"result":{"realm":"3219684284296112065.-5965027431538412822","result":{"type":"string","value":"block"},"type":"success"},"type":"success"}
2025-12-15T15:33:03.163Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[279 bytes] checkVisibility>","awaitPromise":true,"arguments":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53"},{"type":"object","value":[["withinViewport",{"type":"boolean","value":false}],["contentVisibilityAuto",{"type":"boolean","value":true}],["opacityProperty",{"type":"boolean","value":true}],["visibilityProperty",{"type":"boolean","value":true}]]}],"target":{"context":"630EC351DF3F378C19BC6353D5447A15"}}
2025-12-15T15:33:03.164Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[423 bytes] anonymous>","awaitPromise":true,"arguments":[{"sharedId":"f.630EC351DF3F378C19BC6353D5447A15.d.5CE0A603D59A0A780971F54AE092A2B1.e.53"},{"type":"string","value":"display"}],"target":{"context":"630EC351DF3F378C19BC6353D5447A15"}}
2025-12-15T15:33:03.249Z INFO webdriver: BIDI RESULT {"id":21,"result":{"realm":"3219684284296112065.-5965027431538412822","result":{"type":"boolean","value":false},"type":"success"},"type":"success"}
2025-12-15T15:33:03.418Z INFO webdriver: BIDI RESULT {"id":22,"result":{"exceptionDetails":{"columnNumber":8,"exception":{"type":"error"},"lineNumber":13,"stackTrace":{"callFrames":[{"columnNumber":14,"functionName":"","lineNumber":13,"url":""},{"columnNumber":32,"functionName":"anonymous","lineNumber":16,"url":""},{"columnNumber":17,"functionName":"callFunction","lineNumber":3,"url":""},{"columnNumber":13,"functionName":"","lineNumber":5,"url":""}]},"text":"Error: stale element reference: element is not attached to the page document"},"realm":"3219684284296112065.-5965027431538412822","type":"exception"},"type":"success"}
2025-12-15T15:33:03.485Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:03.523Z INFO webdriver: BIDI RESULT {"id":23,"result":{"nodes":[]},"type":"success"}
2025-12-15T15:33:03.525Z DEBUG webdriverio: command getCSSProperty was called on an element ("//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]") that wasn't found, waiting for it...
2025-12-15T15:33:03.525Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:03.607Z INFO webdriver: BIDI RESULT {"id":24,"result":{"nodes":[]},"type":"success"}
2025-12-15T15:33:03.627Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:03.658Z INFO webdriver: BIDI RESULT {"id":25,"result":{"nodes":[]},"type":"success"}
2025-12-15T15:33:03.727Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:03.754Z INFO webdriver: BIDI RESULT {"id":26,"result":{"nodes":[]},"type":"success"}
2025-12-15T15:33:03.827Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:03.854Z INFO webdriver: BIDI RESULT {"id":27,"result":{"nodes":[]},"type":"success"}
2025-12-15T15:33:03.927Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:03.954Z INFO webdriver: BIDI RESULT {"id":28,"result":{"nodes":[]},"type":"success"}
2025-12-15T15:33:04.026Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":"//div[contains(@class, 'main-module_ms-main-bot__QKkRf')]"},"context":"630EC351DF3F378C19BC6353D5447A15"}
2025-12-15T15:33:04.059Z INFO webdriver: BIDI RESULT {"id":29,"result":{"nodes":[]},"type":"success"}
.. repeated infinitely ...Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable