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
We have several different environments that we want to run tests against. I want to run the same Alchemy tests on all the environments or deployments of the app. Is there a way I can configure my tests to do that? Also, in my Devops pipeline how would I design the command-line to execute against each specific environment?
0 Votes
Mason posted 5 months ago Best Answer
In the Alchemy Desktop client where you develop your test, go to the "Configurations" tab. There you'll see a single environment variable called "url". The variable can have different values based on the environment names to the right. The user can add or delete environments there, and give them different values. Addtionally, the user can also add other environment specific varibles other than "url", if desired. The url given during suite creation will be in the "Default" environment. That's the one that will be used for recording, developing,executing the script from the Alchemy Desktop Client.
Now, for using the specific Environment Names during command-line executions use the "-e" command-line option. For example:
java -jar MyTestSuite.jar -e Staging
This will run the test suite using the "url" environment variable value that the user placed in the "Staging" environment slot prior to building the suite executable jar.
Configurations tab
2 Votes
2 Comments
Mason posted 5 months ago Answer
In the Alchemy Desktop client where you develop your test, go to the "Configurations" tab. There you'll see a single environment variable called "url". The variable can have different values based on the environment names to the right. The user can add or delete environments there, and give them different values. Addtionally, the user can also add other environment specific varibles other than "url", if desired. The url given during suite creation will be in the "Default" environment. That's the one that will be used for recording, developing,executing the script from the Alchemy Desktop Client.
Now, for using the specific Environment Names during command-line executions use the "-e" command-line option. For example:
java -jar MyTestSuite.jar -e Staging
This will run the test suite using the "url" environment variable value that the user placed in the "Staging" environment slot prior to building the suite executable jar.
Configurations tab
2 Votes
TheBugScout posted 3 months ago
If you want to execute your test with an environment-specific URL, the first thing you need to do is ensure that your test does not have a hardcoded URL value in the navigate action. Instead, you need to replace that URL value with a URL variable from the configuration section.
What is the configuration section.
In the configuration section, you can create different environments as needed and define properties for each environment. Your environments could include a testing environment, development environment, production environment, staging environment, etc. You can create as many environments as needed and set the required properties for each one.
For example, if you have created different environments with different URLs and you want to configure your test with an environment-specific URL, you need to remove the hardcoded URL value from the navigate action and replace it with the URL variable.
To do this:
Once you have done this, half of your work is complete. Now, you can run your test on the required environment by simply selecting the desired configuration in the "Current Configuration" dropdown. However, note that setting the environment value in the "Current Configuration" dropdown will only execute the test in that environment within the Alchemy UI itself. This does not mean that if you generate the executable and run it through the command prompt using the
java -jar "suitename.jar"
command, it will execute your suite on that environment.If you want your suite to execute on a specific environment during command-line execution, you need to switch the environment using the command
java -jar "suitename.jar" -e Staging
. This will execute your suite in the staging environment during command-line execution. Otherwise, simply executing the suite with the commandjava -jar "suitename.jar"
will run your suite on the default URL specified during recording.Thanks!
0 Votes
Login or Sign up to post a comment