Skip to content

Commit

Permalink
Update the jshandle wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 authored and inancgumus committed Jun 18, 2024
1 parent cc3a209 commit 0d5bdcb
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ weight: 06

# JSHandle

JSHandle represents an in-page JavaScript object.
Represents a reference to a JavaScript object within the context of a webpage. This allows you to interact with JavaScript objects directly from your script.

{{< docs/shared source="k6" lookup="browser-module-wip.md" version="<K6_VERSION>" >}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: 'Browser module: JSHandle.asElement method'

# asElement()

Returns either `null` or the object handle itself, if the object handle is an instance of [ElementHandle](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/elementhandle/).
Returns either `null` or the object handle itself, provided the object handle is an instance of [ElementHandle](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/elementhandle/).

### Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: 'Browser module: JSHandle.dispose method'

# dispose()

Stops referencing the element handle.
Releases the remote object this references.

### Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: 'Browser module: JSHandle.evaluate(pageFunction[, arg]) method'

# evaluate(pageFunction[, arg])

Evaluates the `pageFunction` and returns its return value. This method passes this handle as the first argument to the `pageFunction`.
Returns the value of the `pageFunction` invocation. It passes this handle as the first argument to the `pageFunction`.

<TableWithNestedRows>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ description: 'Browser module: JSHandle.evaluateHandle(pageFunction[, arg]) metho

# evaluateHandle(pageFunction[, arg])

Evaluates the `pageFunction` and returns a `JSHandle`. This method passes this handle as the first argument to the `pageFunction`. Unlike [evaluate](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/jshandle/evaluate/), `evaluateHandle` returns the value as a `JSHandle`
Returns the value of the `pageFunction` invocation as a `JSHandle`. It passes this handle as the first argument to the `pageFunction`.

The only difference between [evaluate](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/jshandle/evaluate/) and `evaluateHandle` is that `evaluateHandle` returns [JSHandle](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/browser/jshandle/).

<TableWithNestedRows>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: 'Browser module: JSHandle.getProperties() method'

# getProperties()

Fetches a map with own property names of of the `JSHandle` with their values as `JSHandle` instances.
This allows you to inspect and interact with the properties of the object within the page context.

### Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: 'Browser module: JSHandle.jsonValue() method'

# jsonValue()

Fetches a JSON representation of the object.
Retrieves the JSON representation of the JavaScript object that the JSHandle refers to, making it easy to work with the data outside the browser context.

### Returns

Expand Down

0 comments on commit 0d5bdcb

Please sign in to comment.