0

I am using Selenium remote webdriver.

This is an outline on how my code looks:

driver = webdriver.Remote(command_executor = myip, desired_capabilities = DesiredCapabilities.CHROME)
url = "someurl.com"

def test1(input):
    driver.get(url)
    driver.implicitly_wait(10)
    ...
    
def test2(input):
    driver.get(url)
    driver.implicitly_wait(10)
    ...
    
def test3(input):
    driver.get(url)
    driver.implicitly_wait(10)
    ...
    
def test4(input):
    driver.get(url)
    driver.implicitly_wait(10)
    ...

In my log, I will see that test1 and test2 completed successfully, but for test3 and test4 I get the error: invalid session id on the driver.get(url) lines. All the tests start the same way, and I'm not quitting or closing the driver until the very end (after all tests run).

Is there a reason this is happening?

formicaman
  • 1,317
  • 3
  • 16
  • 32

0 Answers0