har-export-trigger | Trigger HAR export any time | Functional Testing library
kandi X-RAY | har-export-trigger Summary
kandi X-RAY | har-export-trigger Summary
Firefox add-on improving automated HAR (HTTP Archive) export of collected data from the Network panel. This add-on is built on top of native developer tools in Firefox. Firebug is not needed for this add-on. The add-on exports HAR API directly to the page. Any automated system can be consequently built on top of the API and trigger HAR export using a simple JavaScript call at any time. It can be also nicely integrated with e.g. Selenium to implement automated HAR export robots for existing automated test suites.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- This is the main function that exports the export driver .
- Helper function to run a function
- WebSocket security check
- Expose an object to a new function that controls the content of the content
- import a import object
- Safe require functions
- Main tooltips
- Unload tooltips .
har-export-trigger Key Features
har-export-trigger Examples and Code Snippets
Community Discussions
Trending Discussions on har-export-trigger
QUESTION
I want to be able to get a body of the specific subrequest using a selenium behind the proxy.
Now I'm using python + selenium + chromedriver. With logging I'm able to get each subrequest's headers but not body. My logging settings:
caps['loggingPrefs'] = {'performance': 'ALL', 'browser': 'ALL'}
caps['perfLoggingPrefs'] = {"enableNetwork": True, "enablePage": True, "enableTimeline": True}
I know there are several options to form a HAR with selenium:
- Use geckodriver and har-export-trigger. I tried to make it work with the following code:
window.foo = HAR.triggerExport().then(harLog => { return(harLog); }); return window.foo;
Unfortunately, I don't see the body of the response in the returning data.
- Use browsermob proxy. The solution seems totally fine but I didn't find the way to make browsermob proxy work behind the proxy.
So the question is: how can I get the body of the specific network response on the request made during the downloading of the webpage with selenium AND use proxies.
UPD: Actually, with har-export-trigger I get the response bodies, but not all of them: the response body I need is in json, it's MIME type is 'text/html; charset=utf-8' and it is missing from the HAR file I generate, so the solution is still missing.
UPD2: After further investigation, I realized that a response body is missing even on my desktop firefox when the har-export-trigger add-on is turned on, so this solution may be a dead-end (issue on Github)
UPD3: This bug can be seen only with the latest version of har-export-trigger. With version 0.6.0. everything works just fine.
So, for future googlers: you may use har-export-trigger v. 0.6.0. or the approach from the accepted answer.
...ANSWER
Answered 2019-Feb-17 at 20:34I have actually just finished to implemented a selenium HAR script with tools you are mentioned in the question. Both HAR getting from har-export-trigger and BrowserMob are verified with Google HAR Analyser.
A class using selenium, gecko driver and har-export-trigger:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install har-export-trigger
Following instructions describe how to build the extension from the source and run on your machine.
Install JPM: npm install jpm -g (read more about installing jpm)
Get the source: git clone https://github.com/firebug/har-export-trigger.git
Install required NPM modules: npm install
Run jpm run -b nightly in the source directory (learn more about jpm commands)
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page