O
O
Olga Belova2019-04-09 03:27:17
Python
Olga Belova, 2019-04-09 03:27:17

Shutting down ChromeDriver on Bamboo server?

Given -
PyTest Framework on Bamboo Server
Issue - Tests running time reaches 600 minutes - chromedriver does not exit correctly.
There is a Frontend file in which all actions on objects are registered (clicks, selection from lists, etc.), from which the Authorization class is called for the test and it looks like this

class Authorization(__Base):
    @allure.step('Autorization to the Application as {1} successful')
    def login(self, login, passwd):
        el = self._browser.get_by_id('UN')
        el.send_keys(login)
        self._browser.get_by_id('Pass ').send_keys(pass)
        self._browser.get_by_id('bl').click()
        time_start = time()

        while self._browser.get_by_id('btnLogin', need_fail=False, custom_time_out=1):
            if time() - time_start > 5:
                raise FailStep('not authorization after 5s')

In the test itself, the class call for authorization looks like this:
def test_qata_00(log, frontend):
    frontend.open_url('https://someurl')
    frontend.authorization.login(frontend.login, frontend.passwd)

To complete the test,
frontend.deauthorization.logout() is called
which is written as follows ;
class Deauthorization(__Base):
    @allure.step('Correct Deautorization from Application')
    def logout(self):
        # Clear browser cookie
        self._browser.delete_all_cookies()
        #Close browser
        self._browser.quit()

The test passes and crashes on frontend.Deauthorization.logout() if this command is commented out #frontend.deauthorization.logout() - the result is positive, but the chromedriver is not killed after the test.
How to solve the issue?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question