-1

working in ubuntu instance

installed python 3.7.8 
installed pip3
installed virtual environment
behave 
behave web driver
allure-behave
selenium
chrome driver

when running the feature files I get errors

Exception Attribute Error: 'Options' object has no attribute 'arguments'
Traceback (most recent call last):
File "/home/ubuntu/v/bin/behave", line 8, in <module>
    sys exit(main())
 File "/home/ubuntu/v/lib/python3.8/site-packages/behave/__main__.py", line 183, in main
    return run behave(config) File "/home/ubuntu/v/lib/python3.8/site-packages/behave/__main__.py", line 127, in run behave
    failed = runner run()
  File "/home/ubuntu/v/lib/python3.8/site-packages/behave/runner.py", line 804, in run
    return self run with paths()
  File "/home/ubuntu/v/lib/python3.8/site-packages/behave/runner.py", line 808, in run with paths
    self. load hooks()
  File "/home/ubuntu/v/lib/python3.8/site-packages/behave/runner.py", line 784, in load hooks
    exec file(hooks path, self hooks)
  File "/home/ubuntu/v/lib/python3.8/site-packages/behave/runner_util.py", line 386, in exec file
    exec(code, global , locals_)
  File "x/features/environment.py", line 2, in <module>
    from core environment import behave driver, launch Browser, close Browser
  File "/home/ubuntu/core/environment.py", line 19, in <module>
    options arguments("--no-sandbox","--headless");
Attribute Error: 'Options' object has no attribute 'arguments'

Buddy Bob
  • 5,829
  • 1
  • 13
  • 44
tom
  • 11

1 Answers1

0

That's not the right way to pass the options to the driver.

Example using chrome driver:

from selenium import webdriver

chrome_options = webdriver.ChromeOptions()
chrome_options.add_arguments("--no-sandbox")
chrome_options.add_arguments("--headless")

browser = webdriver.Chrome(options=chrome_options)
herickmota
  • 457
  • 6
  • 13