Change desktop screen resolution
The TestingBot Desktop VMs (Windows, macOS and Linux) all support changing the screen-resolution before a test starts.
We currently support the following screen resolutions:
Value Type | Default Value | |||||||
---|---|---|---|---|---|---|---|---|
string | "1280x1024" |
|
To change the screen resolution, please specify the screen-resolution
parameter in the browserWSEndpoint
URL.
const puppeteer = require('puppeteer-core')
const capabilities = {
'tb:options': {
key: process.env.TB_KEY,
secret: process.env.TB_SECRET
},
browserName: 'chrome',
browserVersion: 'latest',
'screen-resolution': '1600x900'
}
const browser = await puppeteer.connect({
browserWSEndpoint: `wss://cloud.testingbot.com/puppeteer?capabilities=${encodeURIComponent(JSON.stringify(capabilities))}`
})
const page = await browser.newPage()
await page.goto('https://testingbot.com')
await page.screenshot({ path: 'screenshot.png' })
browser.close()
Changing the screen resolution does not resize the viewport. To change the viewport with Puppeteer, please use
page.setViewport
.