theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 309 forks source link

switchToParentFrame errors in IE 11 (but not 10) #1081

Closed maxbeatty closed 4 years ago

maxbeatty commented 4 years ago

Expected behavior

switchToParentFrame should work consistently across browsers

Current behavior

"Command not found" when POST /session/{{session_id}}/frame/parent

2020-1-28 19:20:19:792 REQUEST [2020-1-28 19:20:19:792] POST /session/24f3560ccc2496d466c29fff3f40410628bd04ed/frame/parent {}
2020-1-28 19:20:19:799 RESPONSE {"status":404,"sessionId":"<no session>","value":"Command not found: POST /session/24f3560ccc2496d466c29fff3f40410628bd04ed/frame/parent"}

Possible solution

Maybe there's a workaround with alternate syntax?

Steps to reproduce (for bugs)

  1. example repo: https://github.com/maxbeatty/example-intern
    1. checkout
    2. yarn install
    3. put browserstack credentials in .env or export in shell
    4. yarn test --browserstack --browser ie --browser-version 11
  2. ci build
  3. happy to share any logs or access to BrowserStack builds

Environment

Intern version: 4.8.0 Node version: circleci/node:lts NPM version: yarn v1.21.1 Browser version: Internet Explorer 11

jason0x43 commented 4 years ago

From the error it looks like the session may have become invalid ("sessionId":"<no session>"). POSTing to /session/<session id>/frame/parent is a valid command for both W3C webdriver and JsonWireProtocol, so it should work in all cases.

Does this always happen, or only sometimes?

jason0x43 commented 4 years ago

Ok, I see what's happening, at least partly. Neither IE10 nor 11 support the /frame/parent command, but we're only executing the fallback code for IE10.

maxbeatty commented 4 years ago

if you can point me to the current fallback, I could try to make a PR to fix for IE 11