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

har export trigger does not work at all ... #54

Open
alex4200 opened this issue Aug 24, 2018 · 1 comment
Open

har export trigger does not work at all ... #54

alex4200 opened this issue Aug 24, 2018 · 1 comment

Comments

@alex4200
Copy link

alex4200 commented Aug 24, 2018

I tried the description given in the main page: http://www.softwareishard.com/blog/har-export-trigger/

and created the following script:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

profile = webdriver.FirefoxProfile()
profile.set_preference("devtools.netmonitor.har.contentAPIToken", True)
profile.set_preference("extensions.netmonitor.har.autoConnect", True)
profile.set_preference("devtools.netmonitor.har.enableAutoExportToFile", True)

driver = webdriver.Firefox(firefox_profile=profile)
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

I downloaded the extension from this page and put it into the firefox extension folder (which I need to do later as the tests are running inside a docker image. So I need a way to copy and enable an extension without any firefox GUI), renamed as

[email protected]

However, after running the script, no har file or folder is being created.

@soulgalore
Copy link

Hi @alex4200 if you are using later versions of Firefox you need to use https://github.com/devtools-html/har-export-trigger to get the HAR. If I remember correctly firebug/har-export-trigger only works in FF 54 or earlier.

For copying/installing the plugin in Docker, you can mount the plugin from the outside of the container and add the extension something like this, (that is NodeJS of Selenium but it should be something like that in Python too).

Best
Peter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants