No results for

Powered byAlgolia
⚠️ This is the archived documentation for k6 v0.47. Go to the latest version.

setContent(html[, options])

Sets the supplied HTML string to the current page.

ParameterTypeDefaultDescription
html
string''HTML markup to assign to the page.
options
objectnull

Example

import { browser } from 'k6/experimental/browser';
export const options = {
scenarios: {
browser: {
executor: 'shared-iterations',
options: {
browser: {
type: 'chromium',
},
},
},
},
}
export default async function () {
const page = browser.newPage();
const htmlContent = `
<!doctype html>
<html>
<head><meta charset='UTF-8'><title>Test</title></head>
<body>Test</body>
</html>
`;
page.setContent(htmlContent);
}