SessionNotCreatedException: Message: session not created from tab crashed in Python with Odoo, But selenium working fine alone , [duplicate]

故事扮演 提交于 2020-11-29 02:41:34

问题


I am using the selenium integrating with odoo 13
executing the code:

driver = webdriver.Chrome('/home/dev/chromedriver')

from odoo. I think there is some conflict with odoo session. But when I execute this code form a separate python file, it works well. I also tried to execute this code using Django application on a button click . It works well and browser will open. But in odoo project it won't work. I am really confused why it is not working.

Odoo Server Error
    Traceback (most recent call last):
      File "/home/dev/odoo13_home/odoo-13.0/odoo/http.py", line 619, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/http.py", line 309, in _handle_exception
        raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
      File "/home/dev/odoo13_home/odoo-13.0/odoo/tools/pycompat.py", line 14, in reraise
        raise value
      File "/home/dev/odoo13_home/odoo-13.0/odoo/http.py", line 664, in dispatch
        result = self._call_function(**self.params)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/http.py", line 345, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/service/model.py", line 93, in wrapper
        return f(dbname, *args, **kwargs)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/http.py", line 338, in checked_call
        result = self.endpoint(*a, **kw)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/http.py", line 909, in __call__
        return self.method(*args, **kw)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/http.py", line 510, in response_wrap
        response = f(*args, **kw)
      File "/home/dev/odoo13_home/odoo-13.0/addons/web/controllers/main.py", line 1323, in call_button
        action = self._call_kw(model, method, args, kwargs)
      File "/home/dev/odoo13_home/odoo-13.0/addons/web/controllers/main.py", line 1311, in _call_kw
        return call_kw(request.env[model], method, args, kwargs)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/api.py", line 395, in call_kw
        result = _call_kw_multi(method, model, args, kwargs)
      File "/home/dev/odoo13_home/odoo-13.0/odoo/api.py", line 382, in _call_kw_multi
        result = method(recs, *args, **kwargs)
      File "/home/dev/odoo13_home/odoo-13.0/custom_modules_13/testing/models/models.py", line 28, in send_whatsapp_message
        driver = webdriver.Remote(service.service_url)
      File "/home/dev/odoo13_home/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 152, in __init__
        self.start_session(capabilities, browser_profile)
      File "/home/dev/odoo13_home/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 250, in start_session
        response = self.execute(Command.NEW_SESSION, parameters)
      File "/home/dev/odoo13_home/venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 323, in execute
        self.error_handler.check_response(response)
      File "/home/dev/odoo13_home/venv/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 240, in check_response
        raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.SessionNotCreatedException: Message: session not created
    from tab crashed
      (Session info: chrome=80.0.3987.132)
    Stacktrace:
    #0 0x560acf67fd29 <unknown>

回答1:


(Session info: chrome=80.0.3987.132)

Your chrome version is 80.0.3987.132,Try to download this Chrome webdriver,Add your webdriver folder to system PATH,and try again.



来源:https://stackoverflow.com/questions/60716503/sessionnotcreatedexception-message-session-not-created-from-tab-crashed-in-pyt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!