playwright
playwright copied to clipboard
[Feature] Set private proxy in codegen
Make it possible to use playwright codegen
with the ability to connect private proxies (with login and password), now it is possible to connect only public proxies
An error occurs when trying to pass to the dict
argument.
When passing --proxy--username="username"
, an error is given that there is no such parameter (obviously)
I have not found any other options for transmitting parameters for private proxies, the documentation also says only that you can connect them in the code, but codegen is not affected
+1 for this
In our scenario it's very often that we need to automate a page which is from a different geo-location. Without proxy the page very often redirects to a local counterpart and we need to hack this one way or another every time.
We have a pool of proxies from different continents for that purpose but they are all our own, authenticated, proxies so we cannot use them with npx playwright codegen
:(
+1 for this We also need it to build test scenarios for different geo-locations use-cases
+1 also
We recommend launching "codegen with custom setup" for that: https://playwright.dev/docs/codegen#record-using-custom-setup
const { chromium } = require('@playwright/test');
(async () => {
// Make sure to run headed.
const browser = await chromium.launch({ headless: false });
// Setup context however you like.
const context = await browser.newContext({ /* pass any options */ });
// Pause the page, and start recording manually.
const page = await context.newPage();
await page.pause();
})();
(this works across all the language bindings)
Closing by that!