Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearer network_traffic documentation #275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,17 @@ be automatically cleared at the end of the test.

## Network traffic

* `page.driver.network_traffic` Inspect network traffic (loaded resources) on
the current page. This returns an array of request objects.
* `page.driver.network_traffic` allows you to inspect network traffic (i.e., loaded resources) on the current page. It returns an array of `Ferrum::Network::Exchange` objects, each representing a network request/response exchange. You can query both the request and response details of each exchange.

```ruby
page.driver.network_traffic # => [Request, ...]
request = page.driver.network_traffic.first
request.response
# Retrieve all network exchanges
network_traffic = page.driver.network_traffic

# Access the first exchange
first_exchange = network_traffic.first

# Inspect the response of the first request
response = first_exchange.response
```

* `page.driver.wait_for_network_idle` Natively waits for network idle and if
Expand Down
Loading