codeceptjs / codeceptjs/CodeceptJS

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

Abierto
#1,851 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
4.2k
Forks
757
Merge medio
2 d 9 h
PR fusionados (30 d)
16

Descripción

#### 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)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.