I
I
Ivan Petrov2017-02-22 15:39:07
Python
Ivan Petrov, 2017-02-22 15:39:07

What causes WinError 10061 in Selenium, pytnoh + pytest?

I use pytest + selenium to test a web application.
I created a file with tests, in one file there are two tests, two functions.

def test_add_one_product_to_cart(app):
    pass

def test_add_multiple_product_to_cart(app):
    pass

this is constest.py file
fixture = None

@pytest.fixture(scope="function")
def app(request):

    global fixture

    if fixture is None:
        fixture = App()

    request.addfinalizer(fixture.destroy)
    return fixture

In theory, the browser opens before each test, and then closes. The first test works fine, but the second one fails due to an error - ConnectionRefusedError: [WinError 10061] The destination computer rejected the connection request
What causes the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Russel777, 2017-03-14
@Russel777

such errors usually fell out when selenium or winium was "incorrectly" connected to the web drivers, of course I'm not strong in pytest, but shouldn't the web driver be declared with selenium? post some more code :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question