Creating AWS VM Image for running Tests
We plan to create an instance on AWS. We plan to:
Step 1: Create an instance using AWS Image with Rapise
Step 2: Customize it for our needs.
Step 3: Create own private instance for spawning on demand.
Step 3 is optional but it is good idea to have a configured image and use it for creation of new instances on demand.
Step 1: Create Pre-Configured VM with Rapise
Let’s do EC2/Create Instance
Search for Rapise.
Normally you should get one result because we maintain only one instance:
This result contains “Rapise v5.6” in the title. Don’t be confused, this image started with Rapise 5.6 and was updated up to current version, you may see it in the details:
Press ‘Select’ to proceed to VM instance creation. You get information about instance sizes and pricing. We recommend to use VM instance of size at least t2.small. If your tests tend to be flaky or have intermittent failures, then consider using t2.large or more - that would save a lot of your time for the small price of faster VM. Scroll down and press ‘Continue’ to do actual VM selection.
If you plan to use web tests, check the number of cores - browsers look better with 2 or more cores. For example, here I’m going to choose t2.medium because it has 2 cores because I plan to run web tests. So I’m choosing it and proceeding to ‘Review and Launch’:
Finally review instance settings, and press ‘Launch’ to proceed:
Now you need to choose an existing or create a new key pair.
We are creating a new one, assigning it some meaningful name and launching:
This will take a while:
And a bit more:
And finally you may go to EC2 instances to see it:
In the instances we may now add some time to it.
We plan to configure this instance and then use it to create more like that, so I’ll name it ‘RapiseBaseConfig’
We see that instance status is `Running`. So we may connect to it using RDP. You may see that Rapise and two browsers are already installed:
Step 2: Configure VM for Running Your Tests
We plan to do the following:
Update browsers to the latest version (run them and check for update).
Configure VM for running nightly tests. I’m creating a batch file ‘disconn.bat’ as described in this KB:
If you plan to use Selenium WebDriver then you need to install corresponding versions of geckodriver.exe, chromedriver.exe and iedriver.exe in to Rapise bin folder as described here:
If you plan to use Rapise for testing Desktop application, you may need to install it to this instance instead of setting up web browsers.
Prepare for Scheduled Execution
There are several ways for doing scheduled execution:
Azure DevOps / TFS
Any other CI/CD tool with
Run RapiseLauncher and configure URL & credentials for the SpiraTeam instance.
We will leave Automation Host Token for the AMI as default. Once we will have actual instances for executing tests - we will assign it accordingly.
Prepare for Jenkins
See this Article for more details:
Prepare for Azure DevOps
See this Article for more details:
Prepare for other CI/CD or Custom Build Toolchain
Rapise is open for any integrations through its command line interface. You may re-use an approach that we used for the Jenkins integration
To build support for any other execution environment.
Step 3: Create Own Private Instance for Spawning on Demand
We plan to create an image based on our pre-configured instance.
It is recommended to do shutdown of your VM before doing the snapshot to make sure its consistency. Preferred way is to use Windows Shutdown from an RDP session:
Once instance status changes to stopped, right click instance on EC2 console and choose Image/Create Image:
Fill information about the configuration you did and Create an Image:
Now you may spawn new instances using this configuration whenever needed. Just choose ‘Launch Instance’
Switch to ‘My AMIs’
And select your pre-configured instance:
Select the instance size (it is set to t2.micro by default while we need t2.small or more), then `Review and Launch`:
Then confirm re-use of previously created private key and ‘Launch Instances’:
Regular instance creation process begins, as before. In a while you will get new running instance pre-configured for execution of Rapise tests.
Now you may rename it, log into it (with the same Administrator password), set Spira Host name and so on - whatever you decided for your instances before.