Low-level instance of puppeteer's browser.
Low-level instance of puppeteer's current page.
Add a class to an element.
CSS selector.
Class name.
Add a <script>
tag to page.
Note that the <script>
tag will be appended to <head>
section.
If you pass url
to argument type
,
you should specify a JavaScript file URL in argument value
.
If you pass path
to argument type
,
you should specify a path to a JavaScript file in argument value
.
If you pass content
to argument type
,
you should pass pure JavaScript code in argument value
.
Additional Notes:
If your script is written in ES module,
you can pass esModule: true
to the options
argument.
Can be url
, path
or content
.
Add a <style>
tag to page.
Note that the <style>
tag will be appended to <head>
section.
If you pass url
to argument type
,
you should specify a CSS file URL in argument value
.
If you pass path
to argument type
,
you should specify a path to a CSS file in argument value
.
If you pass content
to argument type
,
you should pass pure CSS code in argument value
.
Can be url
, path
or content
.
Assert that an element by the given selector has the given attribute and value.
CSS selector.
Attribute name.
Expected value.
Assert that the given checkbox has been checked.
CSS selector.
Assert that an element by given selector has the given class name.
CSS selector.
Expected class name.
Assert that the given element does not have the given class name.
CSS selector.
Class name.
Assert that the cookie of current page has the given name and value.
You can pass an expected value as the second argument. Then it will check the value of given name in cookie.
Expected cookie name.
Expected cookie value.
Assert that the given text appears on the page.
Expected text.
Assert that the given text does not appear within the given selector.
CSS selector.
Expected text you don't want to see.
Assert that the given element is hidden.
CSS selector.
Assert that the given element is missing.
CSS selector.
Assert that the given element is present, though it is not visible.
CSS selector.
Assert that the given element is visible.
CSS selector.
Assert that the current hash begins with the given string.
Expected string.
Assert that the current hash equals the given string.
Expected hash.
Assert that the given checkbox has not been checked.
CSS selector.
Assert that the given <option>
element has not been selected.
The selector
argument should point to a <select>
element.
CSS selector which points to a <select>
element.
Value of <option>
element.
Assert that the current path begins with the given string.
Expected string.
Assert that the current path matches the given path.
Expected path.
Assert that query string has the given key.
You can pass an expected value as the second argument. Then it will check the value of given key in query string.
Expected key in query string.
Expected value of a key in query string.
Assert that the given key is not in query string.
Expected missing key.
Assert that the given radio button has not been selected.
CSS selector.
Radio button value.
Assert that the given radio button has been selected.
CSS selector.
Radio button value.
Assert that the page contains the given text.
Text created and rendered by JavaScript dynamically is acceptable.
Expected text.
Assert that the given text can be found by the given selector.
CSS selector.
Expected text you don't want to see.
Assert that the given <option>
element has been selected.
The selector
argument should point to a <select>
element.
CSS selector which points to a <select>
element.
Value of <option>
element.
Assert that an element has the given style.
CSS selector.
CSS property.
CSS value.
Assert that current page title matches the given title.
Expected title.
Assert that current page title contains the give string.
Expected string.
Assert that title of current page matches the given regular expression.
Regular expression.
Assert that the current URL matches the given URL.
Expected URL.
Assert that the current URL matches the given regular expression.
Regular expression.
Assert that the given element contains expected value.
CSS selector.
Expected value.
Assert that the given element has expected value.
CSS selector.
Expected value.
Assert that the given element does not have expected value.
CSS selector.
Expected value.
Retrieve an attribute of an element.
CSS selector.
Attribute name.
Attribute value.
Return an empty Promise object.
Go back.
puppeteer
's navigation options.
Blur an element.
CSS selector.
Check the given checkbox.
CSS selector.
Clear value of <input>
element or text content of <textarea>
element.
CSS selector.
Click an element.
CSS selector.
Click an element which contains given text.
Text on the <a>
element.
Close current page, but it doesn't exit the browser.
You cannot visit the page any more!
The name of page you want to close.
Retrieve cookie of current page.
Retrieve cookies of current page.
Delete cookie(s).
Double click an element.
CSS selector.
Exit browser and return a Promise
.
Exit browser. You can pass a callback, and the callback will be called after browser exited.
Evaluate a function or an expression in browser.
This method will not retrieve the return value and
this method returns this
to make API chainable.
If you want to retrieve the return value,
please use evaluateWithReturn
method.
Note that this function or expression will be evaluated in browser environment, not in Node.js environment. So you can visit variables in browser also you cannot visit variables in Node.js.
If you want to execute a function in Node.js environment,
please use execute
method instead.
Function or expression.
Arguments of function.
Evaluate a function or an expression in browser and retrieve return value.
Note that this function or expression will be evaluated in browser environment, not in Node.js environment. So you can visit variables in browser also you cannot visit variables in Node.js.
If you want to execute a function in Node.js environment,
please use execute
method instead.
Function or expression.
Arguments of function.
Promise-wrapped return value of the given function.
Execute a function.
When you use function
keyword (not arrow function),
this
context in the function points to current Rize
instance.
NOTE that the function will be executed in Node environment, not in browser.
If you want to evaluate an function in browser environment,
please use evaluate
method instead.
The function to be execute.
Find an element by CSS selector and execute an operation.
CSS selector.
One of available Rize
APIs.
Return value of the operation.
Find an element by CSS selector and execute an operation.
CSS selector.
One of available Rize
APIs.
The first argument of the operation.
Return value of the operation.
Find an element by CSS selector and execute an operation.
CSS selector.
One of available Rize
APIs.
The first argument of the operation.
The second argument of the operation.
Return value of the operation.
Find all elements by CSS selector and pick one to execute an operation.
CSS selector.
Index of the array of result. It starts from 0.
One of available Rize
APIs.
Return value of the operation.
Find all elements by CSS selector and pick one to execute an operation.
CSS selector.
Index of the array of result. It starts from 0.
One of available Rize
APIs.
The first argument of the operation.
Return value of the operation.
Find all elements by CSS selector and pick one to execute an operation.
CSS selector.
Index of the array of result. It starts from 0.
One of available Rize
APIs.
The first argument of the operation.
The second argument of the operation.
Return value of the operation.
Find all elements by XPath and pick one to execute an operation.
XPath expression.
Index of the array of result. It starts from 0.
One of available Rize
APIs.
Return value of the operation.
Find all elements by XPath and pick one to execute an operation.
XPath expression.
Index of the array of result. It starts from 0.
One of available Rize
APIs.
The first argument of the operation.
Return value of the operation.
Find all elements by XPath and pick one to execute an operation.
XPath expression.
Index of the array of result. It starts from 0.
One of available Rize
APIs.
The first argument of the operation.
The second argument of the operation.
Return value of the operation.
Find all elements by the given selector and given text and pick one to execute an operation.
CSS selector.
Expected text that should be in a element,
Index of the array of result. It starts from 0.
One of available Rize
APIs.
Return value of the operation.
Find all elements by the given selector and given text and pick one to execute an operation.
CSS selector.
Expected text that should be in a element,
Index of the array of result. It starts from 0.
One of available Rize
APIs.
The first argument of the operation.
Return value of the operation.
Find all elements by the given selector and given text and pick one to execute an operation.
CSS selector.
Expected text that should be in a element,
Index of the array of result. It starts from 0.
One of available Rize
APIs.
The first argument of the operation.
The second argument of the operation.
Return value of the operation.
Focus on an element.
CSS selector.
Go forward.
puppeteer
's navigation options.
Go to a give URL. If the URL cannot be accessed, an error will be threw.
URL to be navigated.
Retrieve a boolean value indicates if an element has a given class name.
CSS selector.
Expected class name.
Hover on an element.
CSS selector.
Retrieve inner HTML content.
CSS selector. Default is html
.
Determines retrieve inner HTML or outer HTML.
Retrieve if an element is present.
CSS selector.
Retrieve if an element is visible.
CSS selector.
Dispatches a keydown event.
Key name.
Dispatches a keyup event.
Key name.
Click a mouse button at given coordinate.
puppeteer
's mouse options.
Dispatches a mousedown
event.
Mouse button. It can be left
, 'rightor
middle`.
Click count.
Move mouse to the given coordinate.
Dispatches a mouseup
event.
Mouse button. It can be left
, 'rightor
middle`.
Click count.
Open a new page.
This method has two options.
If force
is true, when you open a new page with duplicated name,
existing page will be replaced with this new one.
Otherwise, the existing page will be kept and no new page will be created.
If stayCurrent
is true, after opened a new page,
the active page won't be changed.
Otherwise, the active page will be switched to the new page.
A string to identify the new page. It's useful when switching page.
Retrieve the number of pages.
Press a key to the page or an element by the given selector.
Key name.
CSS selector.
Retrieve value of a key in query string.
Query string key.
Select the given value of a radio button field.
CSS selector.
Value of the radio button.
Refresh current page.
puppeteer
's navigation options.
Remove an existing class
CSS selector.
Existing class name.
Right click an element.
CSS selector.
Save a PDF file of current page.
Path to PDF file.
puppeteer
's PDF options.
Save a screenshot of current page.
Path to screenshot file.
puppeteer
's screenshots options.
Select one or more values on an <select>
element.
CSS selector.
Values you want to choose, which can be one or more.
Dispatches a keypress
and input
event.
This does not send a keydown
or keyup
event.
Character to send into the page.
Set cookie(s).
Sleep and wait for a time.
Time to sleep. The unit is millisecond.
Retrieve style value of an element.
CSS selector.
CSS property.
Switch to another existing page.
If the argument is a number, it will search the page by index in internal pages array and switch to it.
If the argument is a string, it will search the page by the name and switch to it.
The index of the page or the name of the page.
Retrieve text content.
CSS selector. Default is body
.
Retrieve the title of current page.
Toggle a class. If the given class name is existed, it will be removed. If the given class name is not existed, it will be added.
CSS selector.
Class name.
Type some text on an element.
This method won't clear existing value of an element and it only will append the given text.
CSS selector.
Text to be typed.
Uncheck the given checkbox.
CSS selector.
Send a file by the given path to an element.
CSS selector.
Path to file.
Retrieve the URL of current page.
Retrieve value of an <input>
element.
CSS selector.
Set a value of an <input>
element.
CSS selector.
New value.
Retrieve viewport information.
Pause and wait for an element by the given selector.
CSS selector.
Maximum time.
Pause and wait for evaluating an expression or a function.
The function or expression you given will be evaluated in browser not in Node.js environment.
NOTE:
The function or expression will be evaluated many times and puppeteer will check the result of expression or the return value of function. If the result or return value is a falsy value, your function or expression will be evaluated again. And if the result or return value is a truthy value, your function or expression won't be evaulated any more and then go ahead.
That is, your function or expression will be evaluated in a loop until the result or return value is a truthy value.
Expression (you should pass it as string) or function.
Maximum time to wait for in milliseconds.
Arguments of function. No need for expression.
Pause and wait for navigation. (including redirecting and refreshing)
You can specify maximum navigation time (in milliseconds).
Pass 0
to disable.
Maximum navigation time in milliseconds.
Provide credentials for http authentication.
Set extra HTTP headers.
The extra HTTP headers will be sent with every request the page initiates.
This method does not guarantee the order of headers in the outgoing requests.
Extra http headers to be sent with every request.
Set the give user agent string.
The user agent string you want to use.
Generated using TypeDoc
Creates an instance of
Rize
.