You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use utf8 chars in e.g. mock.respond("Hello 🌍!"); I get an error
{
error: "unknown error",
id: 13,
message: "Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.",
stacktrace: "InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
at getCdpBodyFromBiDiBytesValue (<anonymous>:630:15682)
at NetworkRequest.provideResponse (<anonymous>:630:11422)
at NetworkProcessor.provideResponse (<anonymous>:306:2340)
at #processCommand (<anonymous>:469:5683)
at CommandProcessor.processCommand (<anonymous>:469:8152)
at #handleIncomingMessage (<anonymous>:758:321)
at WindowBidiTransport.window.onBidiMessage (<anonymous>:868:2182)
at <anonymous>:1:1",
type: "error"
}
frommyterminal(infologlevel)[0-0]2025-01-20T10:24:08.126ZINFOwebdriver: BIDICOMMANDnetwork.provideResponse{"request":"1EE5DB020A0BEF95CB1CD099A4AE0A05","body":{"type":"string","value":"Hello 🌍!"}}[0-0]2025-01-20T10:24:08.131ZINFOwebdriver: BIDIRESULT{"error":"unknown error","id":13,"message":"Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.","stacktrace":"InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.\n at getCdpBodyFromBiDiBytesValue (\u003Canonymous>:630:15682)\n at NetworkRequest.provideResponse (\u003Canonymous>:630:11422)\n at NetworkProcessor.provideResponse (\u003Canonymous>:306:2340)\n at #processCommand (\u003Canonymous>:469:5683)\n at CommandProcessor.processCommand (\u003Canonymous>:469:8152)\n at #handleIncomingMessage (\u003Canonymous>:758:321)\n at WindowBidiTransport.window.onBidiMessage (\u003Canonymous>:868:2182)\n at \u003Canonymous>:1:1","type":"error"}[0-0]Errorin"Test.should mock hello world"
Error: Timeoutof60000msexceeded.Theexecutioninthetest"Test should mock hello world"tooktoolong.Trytoreducetheruntimeorincreaseyourtimeoutfortestspecs(https://webdriver.io/docs/timeouts). (/home/user/workspace/tests/src/bug.test.ts)atcreateTimeoutError(/home/user/workspace/tests/node_modules/mocha/lib/errors.js:498:15)atRunnable._timeoutError(/home/user/workspace/tests/node_modules/mocha/lib/runnable.js:429:10)atTimeout.<anonymous>(/home/user/workspace/tests/node_modules/mocha/lib/runnable.js:244:24)atlistOnTimeout(node:internal/timers:569:17)atprocess.processTimers(node:internal/timers:512:7)fromtheBiDi-CDPMappertab:
bidi:RECV◂{"channel":"/3/nochan/bidi","id":13,"method":"network.provideResponse","params":{"body":{"type":"string","value":"Hello 🌍!"},"request":"1EE5DB020A0BEF95CB1CD099A4AE0A05"}}bidi{}
debug:queueProcessing event: network.provideResponse
bidi:SEND▸{"type": "error","id": 13,"error": "unknown error","message": "Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.","stacktrace": "InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.\n at getCdpBodyFromBiDiBytesValue (<anonymous>:630:15682)\n at NetworkRequest.provideResponse (<anonymous>:630:11422)\n at NetworkProcessor.provideResponse (<anonymous>:306:2340)\n at #processCommand (<anonymous>:469:5683)\n at CommandProcessor.processCommand (<anonymous>:469:8152)\n at #handleIncomingMessage (<anonymous>:758:321)\n at WindowBidiTransport.window.onBidiMessage (<anonymous>:868:2182)\n at <anonymous>:1:1","channel": "/3/nochan/bidi"}
One way to fix this is to use the TextEncoder to parse it into base64 and back. However this seems a bit redundant, is this something that the browser could better handle?
The text was updated successfully, but these errors were encountered:
See original issue: webdriverio/webdriverio#14089
What happened?
When I use utf8 chars in e.g.
mock.respond("Hello 🌍!");
I get an errorThere is a related bug that that touches the same subject webdriverio/webdriverio#7710 that had this webdriverio/webdriverio#7711 pull request
What is your expected behavior?
get the response
Hello 🌍!
How to reproduce the bug.
Relevant log output
One way to fix this is to use the
TextEncoder
to parse it into base64 and back. However this seems a bit redundant, is this something that the browser could better handle?The text was updated successfully, but these errors were encountered: