Is it possible in Alchemy to execute one function before a test and another function after the test? If so, how can it be done?

Posted 4 months ago by Sanjay

Post a topic
Answered
S
Sanjay

I have a function that needs to be executed before each test and another function to be executed after each test in a suite. How can I set up this arrangement in Alchemy?

0 Votes

P

PrasadLangoju posted 4 months ago Best Answer

Yes, It is possible in Alchemy.

1.Record two different functions in a suite. [Ex: Pre Test and Post Test]

2. Open Alchemy settings. 

3.Go to "IDE Execution Settings" tab and select the "Execute Pre Test functions" and "Execute Post test functions" check boxes.

4. Close that settings window and go to "Suite Details" section. 

5. Click on the "Execute Before each test " dropdown and Select the corresponding function from the list.

6. Click on the "Execute After each test " dropdown and Select the corresponding function from the list.

7. Now Go to "Tests" tab and add tests and record actions in them. 

8. Save the suite and try to execute each test. 

9.You can observe, The "Pre-test" function runs before each test, while the "Post-test" function runs after each test. 

2 Votes


3 Comments

Sorted by
P

PrasadLangoju posted 4 months ago

There is a separate procedure if you want to customize pre-test and post-test functions for a specific test.

1. Record Two different functions in a suite. [Ex : Pre Test and Post Test]

2. Open Alchemy Settings.

3. Go to "IDE Execution Settings" tab and select the "Execute pre test functions" and "Execute Post test functions" check boxes.

4. Close the settings window and go to "Tests" tab, add a test and record actions in it. 

5. Click on the "Edit/View test information" icon of the test. 

6. Select the required functions from the "Execute Before" and "Execute after" dropdowns. 


7. Click on the "Ok" button and Save the suite.


8. Now execute the test.

You'll notice that the pre-test and post-test functions are executed only for the customized test, not for every test in the suite.

1 Votes

S

Sanjay posted 4 months ago

Ok, Can I customize the execution of pre-test and post-test functions for a specific test without applying them to all other tests? 

0 Votes

P

PrasadLangoju posted 4 months ago Answer

Yes, It is possible in Alchemy.

1.Record two different functions in a suite. [Ex: Pre Test and Post Test]

2. Open Alchemy settings. 

3.Go to "IDE Execution Settings" tab and select the "Execute Pre Test functions" and "Execute Post test functions" check boxes.

4. Close that settings window and go to "Suite Details" section. 

5. Click on the "Execute Before each test " dropdown and Select the corresponding function from the list.

6. Click on the "Execute After each test " dropdown and Select the corresponding function from the list.

7. Now Go to "Tests" tab and add tests and record actions in them. 

8. Save the suite and try to execute each test. 

9.You can observe, The "Pre-test" function runs before each test, while the "Post-test" function runs after each test. 

2 Votes

Login or Sign up to post a comment

© Orasi Software, Inc. | All Rights Reserved.