codeceptjs / codeceptjs/CodeceptJS

unable to enter iframe via switchTo(iframeID or iframeName) in edge and mobile chrome browser

オープン
#1,851 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
4.2k
フォーク
757
平均マージ
2日 9時間
マージ済み PR(30日)
16

説明

#### What are you trying to achieve?
enter iframe using I.switchTo(#iframe) with Microsoft Edge browser or Chrome on Android
#### What do you get instead?

> Provide console output if related. Use `--verbose` mode for more details.

```bash
# error when executed in Edge browser
# also frame was found by I.waitForElement() in previous step:

The specified frame was not found in the current frame or window.
no such frame: The specified frame was not found in the current frame or window.
at getErrorFromResponseBody (/Users/wolf/WebstormProjects/newCodeceptJS/node_modules/webdriver/build/utils.js:215:10)
at Request._callback (/Users/wolf/WebstormProjects/newCodeceptJS/node_modules/webdriver/build/request.js:103:64)
at Request.self.callback (/Users/wolf/WebstormProjects/newCodeceptJS/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at Request. (/Users/wolf/WebstormProjects/newCodeceptJS/node_modules/request/request.js:1161:10)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at IncomingMessage. (/Users/wolf/WebstormProjects/newCodeceptJS/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:286:20)

Scenario Steps:
- I.switchTo({"frame":"#ds24_heidelpay_cc_iframe"}) at Test.Scenario (ClassicOrderform_test.js:247:7)
- I.waitForElement({"frame":"#ds24_heidelpay_cc_iframe"}) at Test.Scenario (ClassicOrderform_test.js:246:7)

# -------------
# error when executed in Mobile Chrome on Android phone
# also frame was found by I.waitForElement() in previous step:

Error: invalid argument: missing 'ELEMENT'
(Session info: chrome=74.0.3729.136)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 3.19.8-100.fc20.x86_64 x86_64)
at getErrorFromResponseBody (node_modules/webdriver/build/utils.js:215:10)
at Request._callback (node_modules/webdriver/build/request.js:103:64)
at Request.self.callback (node_modules/request/request.js:185:22)
at Request.EventEmitter.emit (domain.js:448:20)
at Request. (node_modules/request/request.js:1161:10)
at Request.EventEmitter.emit (domain.js:448:20)
at IncomingMessage. (node_modules/request/request.js:1083:12)

Scenario Steps:
- I.switchTo({"frame":"#ds24_heidelpay_cc_iframe"}) at Test.Scenario (ClassicOrderform_test.js:247:7)
- I.waitForElement({"frame":"#ds24_heidelpay_cc_iframe"}) at Test.Scenario (ClassicOrderform_test.js:246:7)

```

> identified workaround for both browsers

```js
// Step to fail:
I.switchTo('#iframeID');

// workaround for Edge and Chrome on Android browser via helper class:
await this.helpers["WebDriver"].browser.switchToFrame('iframeID'); //without #
```

### Details

* CodeceptJS version: 2.3.0 and before
* WebDriverIO: 5.10.9
*[Appium] Creating new AndroidDriver (v1.24.1)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。