-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Hi, I was using this function to execute JS in the page.
public static async Task<string> EvalJSByContextIdAsync(ChromeSession session, long executionContextId, string javaScriptStr)
{
await s.WaitAsync();
var evaluateResponse = await session.Runtime.Evaluate(new Runtime.EvaluateCommand
{
AwaitPromise = false,
Expression = javaScriptStr,
IncludeCommandLineAPI = true,
ContextId = executionContextId,
ObjectGroup = "ChromeDevProtocolWrapper"
});
await session.Runtime.Enable(new Runtime.EnableCommand());
s.Release();
return evaluateResponse.Result.Value.ToString();
}
I will get A command response was not received:Runtime.evaluate error when I call this function more than once.
var check = await CDP.EvalJSByContextIdAsync(session, executionContextId, checkScript);
while (check.Equals("False"))
{
Thread.Sleep(5000);
Console.WriteLine("Sleep");
check = await CDP.EvalJSByContextIdAsync(session, executionContextId, checkScript); //Error here
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels