Your Privacy
We use cookies to give you a better experience in Alchemy Help Center
You can learn more about what kind of cookies we use, why, and how from our Privacy Policy. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings in our cookie banner to change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer. For more details, check out our Privacy Policy link below.
View Privacy Policy
Strictly Necessary Cookies
These cookies are necessary for the website to function and cannot be switched off in our systems, but do not store any person information. They are usually set in response to your actions that triggers a request for services, such as setting your privacy preferences, logging in or filling forms. You can change your browser settings to alert you about these cookies, but some parts of the Website may not work.
View Cookies
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
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
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
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
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