Closed QArsis closed 1 month ago
Thanks for reporting, I will take a look at this.
Also seeing this. Holding off on upgrading to v9 until this gets resolved. Commenting for visibility.
9.2.2 is now out with https://github.com/webdriverio/webdriverio/pull/13781, potentially fixing this!
Seems setting to switchFrame with this update fixed the issue 🥳 Thanks @christian-bromann
Thanks for confirming @thamp59 , if you come across more issues in regards to frames or windows, let me know. Also if you have any suggestions how to generally improve this area. Thanks a lot!
Hello! I can confirm issue is fixed. Thanks a lot!
Just for the record:
await browser.switchFrame(() => Boolean(document.querySelector('#w3-logo')));
const getFrameFunction = (selector) => `() => Boolean(document.querySelector("${selector}"))`;
await browser.switchFrame(eval(getFrameFunction(selector)));
I know "eval" is not a good idea but I failed to find another way. Do not hesitate to suggest a better way ;)
Have you read the Contributing Guidelines on issues?
WebdriverIO Version
v9.2.1
Node.js Version
v22.8.0
Mode
WDIO Testrunner
Which capabilities are you using?
With Windows 11.
What happened?
Hello! I'm currently playing with the latest version v9.2.1 published 2 days ago, as I was waiting for the Iframe fixes about checking visibility (see issue https://github.com/webdriverio/webdriverio/pull/13721 for example). I followed the documentation https://webdriver.io/docs/api/browser/switchFrame and confirm that new "switchFrame(...)" method works and that I can now use wdio methods such as "isExisting()" or "waitForExist()" as expected.
But... Now, actions such as "setValue('...')" or "click()" while being in the frame do no longer work.
Straight-forward example (nothing special to know about, my test page is very simple and contains one Iframe):
Note that these wdio "action" methods worked in previous versions (using "switchToFrame()"), even with the previous v9 last week. I was stucked with the "wait" methods not working in v9 as I always check if element exists before using it. And now, the problem is "reversed".
What is your expected behavior?
After switching to an iframe, actions methods like a simple "click()" work for elements inside the iframe we switched on.
How to reproduce the bug.
Launch a new test executing these WDIO commands. See comments for the test follow-up.
Note: The tested page contains nested iframes. Initially, I was testing with a simpler page with a single iframe. Looks like "switchFrame()" handles the nested frames use case well, which is nice! So, even if it looks more complex than my real test page, I think this is a valid test. The final behavior is the same.
Relevant log output
When action occurs, no error shows up. But nothing happened actually. However, I also tried debugging with "browser.debug()" and console returns...
Complete logs :
Code of Conduct
Is there an existing issue for this?