Skip to content

js is not loaded if the site is unavailable #33

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

Open
tempo810 opened this issue Feb 15, 2019 · 0 comments
Open

js is not loaded if the site is unavailable #33

tempo810 opened this issue Feb 15, 2019 · 0 comments

Comments

@tempo810
Copy link

tempo810 commented Feb 15, 2019

I am using the plugin with Selenium and Firefox 65 in python.
The HAR harvest script is working if I am able to get any response from remote http server.
However, if the site is unreachable such as experiencing gateway timeout then HAR.triggerExport() cannot be called.
My goal is to continuous monitoring http accessibility for further analysis, so it's important to export HAR no matter if the site is reachable or not.
May I know if it's possible to capture HAR in every situation?

Here is the trace when site is not available:
/Users/Tempo/PycharmProjects/SeleniumTest/venv/bin/python /Users/Tempo/PycharmProjects/SeleniumTest/TimeOutTest.py Traceback (most recent call last): File "/Users/Tempo/PycharmProjects/SeleniumTest/TimeOutTest.py", line 51, in <module> har_dict['log'] = ast.literal_eval(browser.execute_script(HAR_HARVEST)) File "/Users/Tempo/PycharmProjects/SeleniumTest/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 636, in execute_script 'args': converted_args})['value'] File "/Users/Tempo/PycharmProjects/SeleniumTest/venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/Users/Tempo/PycharmProjects/SeleniumTest/venv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: ReferenceError: HAR is not defined

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