This is documentation for the next version of K6. For the latest stable release, go to the latest version.
Frame
Frame represents a single frame in a browser window. It can be a top-level frame or an iframe. Frames are used to organize content in a browser window. Frames can be nested, and each frame has its own document and window objects.
Method | Description |
---|---|
frame$(selector) | Finds an element matching the specified selector within the frame. |
frame$$(selector) | Finds all elements matching the specified selector within the frame. |
check(selector[, options]) | Select the input checkbox. |
childFrames() | Returns an array of child frames. |
click(selector[, options]) | Clicks on an element matching a selector . |
content() | Gets the HTML contents of the frame. |
dblclick(selector[, options]) | Double click on an element matching the provided selector . |
dispatchEvent(selector, type, eventInit[, options]) | Dispatches HTML DOM event types e.g. 'click' |
evaluate(pageFunction[, arg]) | Returns the value of the pageFunction invocation. |
evaluateHandle(pageFunction[, arg]) | Returns the value of the pageFunction invocation as a JSHandle. |
fill(selector, value[, options]) | Fill an input , textarea or contenteditable element with the provided value. |
focus(selector[, options]) | Fetches an element with selector and focuses on it. |
frameElement() | Returns the frame ’s element . |
getAttribute(selector, name[, options]) | Returns the element attribute value for the given attribute name. |
goto(url[, options]) | Navigates to the specified url . |
hover(selector[, options]) | Hovers over an element matching selector . |
innerHTML(selector[, options]) | Returns the element.innerHTML . |
innerText(selector[, options]) | Returns the element.innerText . |
inputValue(selector[, options]) | Returns input.value for the selected input , textarea or select element. |
isChecked(selector[, options]) | Checks to see if the checkbox input type is selected or not. |
isDetached() | Returns true if the frame is detached from the DOM. |
isDisabled(selector[, options]) | Checks if the element is disabled . |
isEditable(selector[, options]) | Checks if the element is editable . |
isEnabled(selector[, options]) | Checks if the element is enabled . |
isHidden(selector[, options]) | Checks if the matched element is hidden . |
isVisible(selector[, options]) | Checks if the matched element is visible . |
locator(selector[, options]) | Returns a Locator for the given selector . |
name() | Returns the name of the frame. |
page() | Returns the page containing the frame. |
parentFrame() | Returns the parent frame, if any. |
press(selector, key[, options]) | Focuses the element, and then presses the given key on the Keyboard. |
selectOption(selector, values[, options]) | Selects one or more options which match the values from a <select> element. |
setContent(html[, options]) | Sets the supplied HTML string to the current frame. |
setInputFiles(selector, file[, options]) | Sets the file input element’s value to the specified files. |
setChecked(selector, checked[, options]) | Sets the checkbox or radio input element’s value to the specified checked or unchecked state. |
tap(selector[, options]) | Taps the first element that matches the selector . |
textContent(selector[, options]) | Returns the element.textContent . |
title() | Returns the title of the frame. |
type(selector, text[, options]) | Types the text in the first element found that matches the selector . |
uncheck(selector[, options]) | Unchecks an input checkbox element. |
url() | Returns the frame ’s URL. |
waitForFunction(pageFunction, arg[, options]) | Returns when the pageFunction returns a truthy value. |
waitForLoadState(state[, options]) | Waits for the given load state to be reached. |
waitForNavigation([options]) | Waits for the given navigation lifecycle event to occur and returns the main resource response. |
waitForSelector(selector[, options]) | Returns when element specified by selector satisfies state option. |
waitForTimeout(timeout) | Waits for the given timeout in milliseconds. |