Forum Discussion

jose_pjoseph's avatar
jose_pjoseph
Contributor
9 years ago
Solved

How to achieve before() and after() functionality in Test Complete

Is there an equivalent, or is there a way to achieve, before(), after(), beforeEach(), and afterEach() functionality available @ https://mochajs.org/#hooks?

I want to execute my tests in the sequence below:

 

    Before:

        OpenBrowser()
        Login()
    Tests:
        Project1:
                Test1
                Test2
        Project2:
                Test1
        Project3:
                Test1
                Test2
                Test3
    After:
        Logout()
        CloseBrowser()

 

Update: 

I looked at Events > Test Engine Events > OnStartTest/OnStopTest, which is equivalent to beforeEach() and afterEach(). But could not find anything which is similar to before() and after() - execute steps once before all tests and once after all tests.