Skip to content

Boolean values in options arg #185

@afalco103

Description

@afalco103

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions