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

Boolean values in options arg #185

Open
afalco103 opened this issue Nov 12, 2020 · 0 comments
Open

Boolean values in options arg #185

afalco103 opened this issue Nov 12, 2020 · 0 comments

Comments

@afalco103
Copy link

Hey folks, trying to add some rule specifications into the axe 'run' function but am getting the following error

../venv/lib/python3.6/site-packages/axe_selenium_python/axe.py:53: in run
    response = self.selenium.execute_async_script(command)
../venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:659: in execute_async_script
    'args': converted_args})['value']
../venv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute
    self.error_handler.check_response(response)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x10e914748>
response = {'status': 500, 'value': '{"value":{"error":"javascript error","message":"javascript error: True is not defined\\nJava...fff7082fe65 _pthread_start + 148\\n20  libsystem_pthread.dylib             0x00007fff7082b83b thread_start + 15\\n"}}'}
    axe = Axe(driver)
    axe.inject()
    rules = {"meta-viewport-large": {"enabled": True}}
    results = axe.run(options={'rules': rules})

if I try a rules object like this {"meta-viewport-large": {"enabled": "true"}}, it works. I think it would be helpful to either document that booleans need be formatted like js ones but as strings, or even better have this library automatically convert a Python bool to a stringified js one.

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

1 participant