-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp_creds.js
More file actions
32 lines (27 loc) · 703 Bytes
/
http_creds.js
File metadata and controls
32 lines (27 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({
headless: false,
slowMo: 250,
});
const context = await browser.newContext({
httpCredentials: {
username: 'username',
password: 'password',
},
viewport: {
width: 1920,
height: 1080
}
});
await context.cookies();
const page = await context.newPage();
await page.goto('somewhere');
// do something
await page.waitForTimeout(3000);
await browser.close()
await page.close();
// ---------------------
await context.close();
await browser.close();
})();