title | excerpt |
---|---|
isHidden([options]) |
Browser module: locator.isHidden method |
Checks if the element is hidden
.
Parameter | Type | Default | Description |
---|---|---|---|
options | object | null |
|
options.timeout | number | 30000 |
Maximum time in milliseconds. Pass 0 to disable the timeout. Default is overridden by the setDefaultTimeout option on BrowserContext or Page. |
Type | Description |
---|---|
bool | true if the element is hidden , else false . |
import { chromium } from 'k6/experimental/browser';
export default async function () {
const browser = chromium.launch();
const page = browser.newPage();
await page.goto('https://test.k6.io/browser.php');
const text = page.locator('#input-text-hidden');
if (text.isHidden()) {
console.log('element is hidden');
}
}