Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switchToFrame deprecated in WebdriverIO v9 #6804

Closed
5 of 6 tasks
luc122c opened this issue Oct 28, 2024 · 3 comments · Fixed by #7553
Closed
5 of 6 tasks

switchToFrame deprecated in WebdriverIO v9 #6804

luc122c opened this issue Oct 28, 2024 · 3 comments · Fixed by #7553

Comments

@luc122c
Copy link

luc122c commented Oct 28, 2024

Describe the bug

While using browser testing WebdriverIO V9 (9.2.2), I get the following warning in my console:

⚠️ [WEBDRIVERIO DEPRECATION NOTICE] The "switchToFrame" command is deprecated and we encourage everyone to use `switchFrame` instead for switching into frames. Read more about this command at https://webdriver.io/docs/api/browser/switchFrame.

This seems to be the only usage.

V8 Docs: https://v8.webdriver.io/docs/api/webdriver/#switchtoframe
V9 Docs: https://webdriver.io/docs/api/browser/switchFrame/

Reproduction

N/A

System Info

System:
    OS: macOS 14.6.1
    CPU: (20) arm64 Apple M1 Ultra
    Memory: 27.83 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 9.12.1 - /opt/homebrew/bin/pnpm
    bun: 1.1.33 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 130.0.6723.70
    Safari: 18.0.1
  npmPackages:
    @vitest/browser: ^2.1.4 => 2.1.4 
    @vitest/coverage-istanbul: ^2.1.4 => 2.1.4 
    @vitest/ui: ^2.1.4 => 2.1.4 
    vite: ^5.4.10 => 5.4.10 
    vitest: ^2.1.4 => 2.1.4

Used Package Manager

pnpm

Validations

@luc122c luc122c changed the title "switchToFrame" deprecated in WebdriverIO v9 switchToFrame deprecated in WebdriverIO v9 Nov 13, 2024
@feryardiant
Copy link

This should be easily fixed by changing line 46 of this file

async beforeCommand(): Promise<void> {
const page = this.browser!
const iframe = await page.findElement(
'css selector',
'iframe[data-vitest]',
)
await page.switchToFrame(iframe)
}

@thomascayne
Copy link

Hello. When is this getting shipped? ⚠️ [WEBDRIVERIO DEPRECATION NOTICE] The "switchToFrame" command is deprecated is really annoying and dirty, especially when there are 1300+ tests.

@feryardiant
Copy link

Hello. When is this getting shipped?

At this point all we can do is downgrade to webdriverio v8 while waiting #6398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants