ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

Protocol error (Runtime.runScript): No script with given id #228

Closed cchen124 closed 4 years ago

cchen124 commented 4 years ago

I am trying to execute the below script using the Chrome DevTools Protocol in Puppeteer tests. I receive a protocol error of "Protocol error (Runtime.runScript): No script with given id" at await client.send('Runtime.runScript', {scriptId: idScriptString});.

   `await client.send('Runtime.enable');
   const idScript = await client.send('Runtime.compileScript', {expression: "sessionStorage[\"ShellOverrides\"] = JSON.stringify({UniversalMeControlEnabled:true})", sourceURL: "", persistScript: true});
    const idScriptString = JSON.parse(JSON.stringify(idScript)).scriptId;
    await client.send('Runtime.runScript', {scriptId: idScriptString});
    await client.send('Page.enable');
    await client.send('Page.reload');`

Does anyone have a suggestion of how to begin to debug this?

TimvdLippe commented 4 years ago

This repository is related to Chrome DevTools Protocol, but does not track issues regarding its definition or implementation. If you want to file an issue for the Chrome DevTools Protocol, please open an issue on https://crbug.com under component: Platform>DevTools>Platform. Thanks in advance!