Automai bots are virtual users that navigate your applications from their own desktops in order to create the load during the tests. This unique front-end approach gives a real-world result but also requires real-world set up meaning that each has the licensing for the apps on their desktop.
When running automated testing processes using Office products, it is more difficult considering how you will license Microsoft Office applications. Usually, the cost of licensing each user is cost prohibitive. Microsoft has made this easier by releasing a “Test” product key which you can use to allow full office functionality for a limited period.
Initially, when this key was released, it allowed ten days’ worth of activation. It now enables five days of activation.
We’ll run through applying this key and how we maintain an activated status in a testing environment.
To activate this key
- Open a PowerShell window as an administrator, and change your directory to the Office installation folder.
cd ‘C:\Program files\Microsoft Office\Office16\’
- Run the following command to activate the office release.
cscript OSPP.VBS /inpkey:DRNV7-VGMM2-B3G9T-4BF84-VMFTK
- Now check the status of the activation
script OSPP.VBS /dstatus
You can see here that the office version is activated for a period of 4 days and will expire in 7193 minutes.
If you need more time, you can now rearm your office installation using this command.
cscript OSPP.VBS /rearm
This shows the rearm’ s success, and the grace period is set back to 5 days.
I only managed a single rearm command on my installation, so there are some steps to take on a more technical front to ensure this can be used for testing.
Hiding Unnecessary Prompts
There are a few prompts from office for activation that you can now bypass; we don’t need to see these in a testing environment.
Add the following registry keys to your machine(s) that office is installed on.
64Bit – “HKLM\Software\Microsoft\Office\16.0\Common\Licensing”
DisableActivationUI – DWORD – 1
32Bit – “HKLM\Software\Wow6432Node\Microsoft\Office\16.0\Common\Licensing”
DisableActivationUI – DWORD – 1
There are also some user-based registry keys you may wish to deploy; if you are using the Automai EUC workloads, these will already be configured for you.
64Bit – “HKCU\Software\Microsoft\Office\16.0\Registration”
AcceptAllEulas– DWORD – 1
32Bit – “HKCU\Software\Wow6432Node\Microsoft\Office\16.0\Registration”
AcceptAllEulas – DWORD – 1
Persistent and Non-Persistent Environments
Managing the office activation status is key, and depending on which type of environment you work in will dictate how you do this.
If your provisioned Desktops are non-Persistent, then DO NOT activate office in the above-mentioned fashion on your master image. Instead, Automai provides a machine startup script that will activate office each time the non-Persistent machine is rebooted.
If your provisioned Desktops are persistent, you will need to rely on a re-provision method or a snapshot method to revert machines to a point before they were activated. Roll the machines out without the office activated and use the startup script provided. After five days have elapsed, re-provision the machines again from that exact time and rely on the startup script to do the work for you.
Managing Activation Prompt in Workloads
When running the Automai workloads, the activation sign-in prompt is skipped by pressing the escape key.
Automai watches for the Microsoft logo in the top right of this Window, and if it sees it, it will send the escape key to remove this dialogue and continue the test.