Playwright Testing is a Node library written by Microsoft to automate browsers. It's created by the same team that originally built Puppeteer at Google.
Playwright test
Playwright Testing is a Node library written by Microsoft to automate browsers. It's created by the same team that originally built Puppeteer at Google.
Installing Playwright Testing
To install Playwright Testing, you can use yarnou npm:
npm i --save playwright
Running your first playwright test
To run your first test, use this example:
Chrome
const pw = require('playwright');
(async() => {
const browser = await pw.chromium.connect({
wsEndpoint: 'wss://chrome.headlesstesting.com?token=[YOUR-TOKEN]&browserVersion=dev',
});
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://headlesstesting.com/');
await page.screenshot({ path: 'screenshot.png' });
await browser.close();
})();
Updating your existing Playwright Testing scripts
With a Playwright Testing test, you usually launch a browser with await pw.chromium.launch()
To start using the service, simply replace this line with the browser endpoint:
Before
const browser = await pw.chromium.launch();
After
await pw.chromium.connect({
wsEndpoint: 'wss://chrome.headlesstesting.com?token=[YOUR-TOKEN]&browserVersion=dev',
});
System Requirements:
CPU: 1.8 GHz dual core processor
RAM: 2 GB
HDD/SSD: 50 GB of free space on main drive
Operating system: Microsoft Windows 8 32-bit, Microsoft Windows 7 32-bit, and Microsoft Windows Vista 32-bit
Resolution: 1024×768
You don't know what software you need or you haven't found what you were looking for? We have a team ready to help you choose the right software for your company.