添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 [🐛 Bug]: selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id #12245 [🐛 Bug]: selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id #12245 kingrapha opened this issue Jun 23, 2023 · 4 comments

What happened?

Python language bindings for selenium WebDriver raises a selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id. The browser is closed without triggering driver.quit() or driver.close() yet.

This on selenium grid 4.9.1 configured in kubernetes cluster using helm chart selenium-grid-0.18.0 with keda auto scaling.
In values.yaml file:
ChromeNode:
extraEnvironmentVariables:
- name: SE_NODE_SESSION_TIMEOUT
value: “900”

terminationGracePeriodSeconds: 30
lifecycle: {}
preStop:
exec:
command:
- bash
curl -X POST 127.0.0.1:5555/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' &&
while curl 127.0.0.1:5555/status; do sleep 1; done

How can we reproduce the issue?

options = Options()
options.add_argument(—-no-sandox’)
options.add_argument(—-disable-infoxbars’)
options.add_argument(—-disable-hang-monitor’)
options.add_argument(—-disable-setuid-sandbox’)
options.add_argument(—-disable-dev-shm-usage’)
caps = {‘browserName’: ‘chrome’, ‘platformName’: ‘LINUX’, ‘acceptInsecureCerts’: True}
driver = webdriver.remote(command_executor= https://selenium-grid-url, desired_capabilities=caps, options= options)
   driver.get(“testing application url”)
   wait = WebDriverWait(driver, 60)
   element = wait.until(EC.element_to_be_clickable((By.ID,”locator”)
   element.click()
   wait.until(EC.invisibility_of_element_located((By.ID, “loading-bar”)
   ………more test code……
finally:
   driver.quit()

Relevant log output

raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id

Operating System

Linux

Selenium version

4.9.1

What are the browser(s) and version(s) where you see this issue?

Chrome, 113

What are the browser driver(s) and version(s) where you see this issue?

Chrome webdriver version 113

Are you using Selenium Grid?

4.9.1

@kingrapha , thank you for creating this issue. We will troubleshoot it as soon as we can.

Info for maintainers Triage this issue by using labels. If information is missing, add a helpful comment and then I-issue-template label. If the issue is a question, add the I-question label. If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label. If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue. After troubleshooting the issue, please add the R-awaiting answer label. Thank you! I-question Applied to questions. Issues should be closed and send the user to community resources. and removed I-defect