CONCURRENCY_PAGE - Only the active Tab (page) is automated (the others is pending, on queue) when using
See original GitHub issueHello all,
When I am using CONCURRENCY_PAGE
Concurrency implementations I have the following issue.
Only the active tab (page) is automated. The other is waiting for the other to be completed. Lets say GitHub is the latest triggered automation with the Puppeteer It is active, and everything for its automation is working, but the other 2, yahoo and google are waiting. If I switch manually the tab to let’s say yahoo it is starting to working there and the others are pending for it to finish
Below you can see a snippet of my code (adjusted with test names)
const args= [
//https://github.com/puppeteer/puppeteer/issues/1159 || https://github.com/puppeteer/puppeteer/issues/3119
"--disable-setuid-sandbox",
"--enable-automation",
"--disable-browser-side-navigation",
"--test-type",
"--start-maximized",
"--disable-extensions",
"--disable-popup-blocking",
"--disable-infobars",
"--disable-dev-shm-usage",
"--disable-gpu",
"--no-sandbox",
"--disable-features=InfiniteSessionRestore",
"--enable-features=NetworkService"
];
const options = {
headless: false,
w3c: true,
useAutomationExtension: false,
executablePath: 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe',
// executablePath: 'C:/Program Files/Firefox Nightly/firefox.exe',
// product: 'firefox',
args
// acceptInsecureCerts: true,
// ignoreHTTPSErrors: true
};
const cluster_test= await Cluster.launch({
concurrency: Cluster.CONCURRENCY_PAGE,
monitor: false,
maxConcurrency: 5,
puppeteerOptions: options ,
timeout: 14400000, // 4 hours
workerCreationDelay: 500, // 0.5 seconds delay
});
const automated_process_one= async({ page, data }) => {
return await callFunction
.testFunction(page, data)
.then((result) => {
return result;
})
.catch((error) => {
return cf.errorCatchCustom1(
error.stack,
error.message,
"Error inside cluster.execute:",
"error_log.txt"
);
});
};
app.post("/test", async function(req, res) {
data = req.body["data"];
data.url = `https://test..com_` + data['Test'] + '_' +
try {
let result = await cluster_test.execute(data, automated_process_one);
res.send(result);
} catch (error) {
res.send(
cf.errorCatchCustom1(
error.stack,
error.message,
"Error when calling cluster.execute:",
"error_log.txt"
)
);
}
});
My idea here is that the site that I will automate can’t have more than one session, but I will have more than one run with the same credentials (user). I want here to share the data between the browsers (the runs) and this is why I am using CONCURRENCY_PAGE as the other methods are not using shared data at all. I hope someone can assist here, as it is a big issue for me. The main idea is to have them running in parallel, but they are staying in a queue actually.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9
Top GitHub Comments
If you run with
headless: true
, then this concurrency works as expected…@thomasdondorf I thought the main purpose of CONCURRENCY_PAGE was to run multiple pages in parallel. I reached this limitation with puppeteer and thought that this library could bypass this restriction.
What is the goal of CONCURRENCY_PAGE then?