Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mike10004/selenium-traffic-example
Example of capturing network traffic with Selenium and Browsermob-proxy
https://github.com/mike10004/selenium-traffic-example
Last synced: 15 days ago
JSON representation
Example of capturing network traffic with Selenium and Browsermob-proxy
- Host: GitHub
- URL: https://github.com/mike10004/selenium-traffic-example
- Owner: mike10004
- License: mit
- Created: 2016-11-03T20:43:50.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-15T20:44:26.000Z (about 8 years ago)
- Last Synced: 2024-10-08T09:22:35.469Z (3 months ago)
- Language: Java
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Capturing network traffic with Selenium and Firefox or Chrome
=============================================================This project is an example of how to capture network traffic using Selenium
WebDriver with Browsermob-proxy. Unit tests employing Firefox and Chrome
webdrivers capturing both HTTP and HTTPS traffic are included.The primary reason this project is shared is that many Selenium traffic
capture examples and how-tos suggest the process is rather simple, but in
practice, at least with the version of Firefox the author has, the following
problems were encountered:* merely configuring the `DesiredCapabilities` object for the Firefox
webdriver does not actually configure the driver to use the proxy
* many examples of how to customize the Firefox profile for the webdriver
fail to include instructions for specifying that the same proxy be used for
HTTPS requests
* empty HAR files are produced by browsermob-proxy if the webdriver proxy
is not configured correctly
* by default, the Firefox driver does not accept the certificate provided by
Browsermob-proxy to MITM SSL traffic, and configuring the Firefox profile
for the webdriver to accept a custom self-signed certificate is nontrivial
* Browsermob-proxy does not respect the system properties that define a proxy
for the JVM, so if you have an upstream proxy, the Browsermob proxy
must be configured explicitly from the system propertiesThis project is a working demonstration of network traffic capture that is
small enough to comprehend but shows a fair number of ways you can customize
it for your needs.