Skip to content

Commit

Permalink
Update README.md on network traffic method
Browse files Browse the repository at this point in the history
  • Loading branch information
yann120 authored Sep 19, 2024
1 parent 503179f commit 3df0421
Showing 1 changed file with 9 additions and 5 deletions.
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

0 comments on commit 3df0421

Please sign in to comment.