Open gorzko opened 1 year ago
I think latest release of chrome driver causing this issue
I'm working on a Target manager refactor that might help here.
There are two ways Frames are added to the ConcurrentDictionary
, only the frames created in OnFrameNavigatedAsync
will resolve the Task
created by GetItemAsync
. The frames created in OnFrameAttached
are added to the ConcurrentDictionary
directly and never resolve any pending Tasks
.
If someone wants to try out a potential fix it's available at https://github.com/amaitland/puppeteer-sharp/commit/6983ba0c0712a59598df72c56f5894847bbe80c6
@amaitland Do you think we can have a PR with that change?
Sure, PR #2049 created
@gorzko Can you try out version 9.0
? Hopefully this should be resolved.
@amaitland @kblok After update to the last version, my program deadlocks on browser = await Puppeteer.ConnectAsync(new ConnectOptions { BrowserURL = browserUrl, DefaultViewport = null });
.
@gorzko Probably related to #2051
If you can create a self contained example that reproduces the problem then I'd be creating a new issue.
@amaitland I'm not sure if that's what's needed, but that's a code that reproduces the issue:
using PuppeteerSharp;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace PuppeteerStuck
{
internal class Program
{
private static void Main(string[] args)
{
Process.Start("msedge", "\"https://www.google.com\" -remote-debugging-port=21222");
while (true)
{
if (Process.GetProcessesByName("msedge").Where(p => p.MainWindowTitle.StartsWith("Google")).Any())
{
break;
}
else
{
System.Threading.Thread.Sleep(1000);
}
}
ConnectBrowser().GetAwaiter().GetResult();
}
private static async Task ConnectBrowser()
{
var browser = await Puppeteer.ConnectAsync(new ConnectOptions
{
BrowserURL = "http://127.0.0.1:21222",
DefaultViewport = null
});
}
}
}
Application gets stuck on var browser = ...
in PuppeteerSharp 9.0.x. On versions 7.1.0 and 8.0.0 it works fine.
@gorzko Best to create a new issue as that seems unrelated to this issue.
Description
I'm using PuppeteerSharp in an RPA (Blue Prism) project for some specific things, mostly invoking JS. With most pages it works just fine, but there is an issue with SAP Concur. When webpage is navigated outside of Puppeteer (manually or by Blue Prism) I get one of these errors:
First exception can be easily solved by executing Connect / AttachPage again, but then I always land with the second one.
Complete minimal example reproducing the issue
Main code 1:
Main code 2:
My helper class:
Expected behavior:
If webpage is navigated externally after Connect / AttachPage, exception can be expected. But if it is navigated before
browser
andpage
are initialized, it should invoke JS.Versions
Additional Information
During debuging I found out that before external navigation
page
had three frames:After navigation it also had three, with two of them with different IDs
However in exception there is frame
6EA76FD7E7417DC0F62D5B1BBFB4E2FA
mentioned... where did it come from?