While I'm trying to record the web based application using Playwright tool and after launching the application getting as NET::ERR_CERT_AUTHORITY_INVALID .
After recording and in the playwright tool the application url code is not getting recorded.
If you trust the domain, or are using your own self-signed certificate, this error can be avoided by adding ignoreHTTPSError: true
when creating the context:
... = browser.newContext({ ignoreHTTPSErrors: true });
or in Python
... = browser.new_context(ignore_https_errors=True)
or in C#
... = browser.NewContextAsync(new BrowserNewContextOptions { IgnoreHTTPSErrors = true });
Or when starting codegen
:
playwright codegen https://localhost/ --ignore-https-errors
First approach : Request your development team to update the SSL certificate , since it has expired . Which is causing the error NET::ERR_CERT_AUTHORITY_INVALID
Second approach Use the below code to ignore any HTTPSErrors (Would recommend doing the below only if first approach is not doable by your development or IT team)
const newBrowser = await chromium.launch();
const context = await newBrowser.newContext({
ignoreHTTPSErrors: true
});
const page = await context.newPage();
await page.goto(URL);