简体   繁体   中英

Count Http Requests using Selenium WebDriver with NodeJS?

How can I count Http Requests using Selenium WebDriver with NodeJS?

I was thinking of using a http request interceptor.

Here is a possible solution with extension:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Intercept_HTTP_requests

I would like to set an interceptor while I am creating a web-driver instance instead of using an extension since I want to use web-driver anyway and have problem to set it to run with extensions.

Confused on what you want to do- capture the the network requests using native functionality exposed by selenium-webdriver? And extensions meaning a wrapper on top of selenium-webdriver like selenium-extend or an actual chrome extension? I work with webdriver a ton for interesting stuff (not QA work) as well as Puppeteer. If you want to interface directly with chrome and get all the goodies from DevTools, AND you dont need to be running your scraper or uh test against a selenium grid, consider using puppeteer instead. [ https://github.com/GoogleChrome/puppeteer][1]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM