Archive of ‘Automation’ category

Simple steps to set up MSDeploy 3.5 on server

These steps were used to get MSDeploy 3.5 set up on Windows Server 2008 R2:

  1. Hit Start and search for ‘Turn Windows features on or off’
  2. Select Roles -> Web Server (IIS) in the left menu and then right click and select ‘Add Role services’
  3. Then in popup check the ‘Management Service’ box under Management Tools
  4. Go to Management Service in IIS after clicking on the computer name node in the left column
  5. Enable it and assign a self signed cert. I selected Windows or IIS manager credentials and left the default port
  6. Install Web Platform Installer
  7. Optional: Install web deployment tool 2.1
  8. Install Web Deploy 3.5
  9. Create a user called msdeploy (or whatever you set in your config) and make it an admin.
  10. Try going to https://SERVERIP:8172/msdeploy.axd in your browser. E.g. https://94.229.173.52:8172/msdeploy.axd
  11. You may need to open up that port in the firewall.
  12. Login using user above and you should be directed to blank page if the login works – still a 404. Otherwise you will get a 401 if you cancel out of login box
  13. You will need to give the msdeploy user file system access rights to the folder that you want to deploy to. This can be done by following the steps under ‘Configuring a deployment user’ heading on this post: http://blog.richardszalay.com/2013/02/02/building-a-deployment-pipeline-with-msdeploy-part-4-server-configuration/
  14. You could need to make sure that the WMSvc has the privileges to use the runCommand provider. The correct way to do this give the msdeploy user “replace a process level token” rights using secpol.msc (local policies -> User Rights Management) – http://forums.iis.net/t/1182636.aspx
  15. If that doesn’t work then we should override the privileges for WMSvc (Web Management Service) service to execute runCommand successfully. (See the ‘Troublehunting’ heading on this page http://tech-fellow.net/2012/12/07/deploy-windows-service-remote-machine-msdeploy/)
  16. Make sure that the “Web Management Service” and “Web Deployment Agent Service” are set to automatic start up

One useful thing to do if you are troubleshooting is running this in the console (vs a batch file) and you’ll get a stack trace.

Useful blog posts that I used as reference:

Automating the cost calculator

I’m going to share a short example of how I automated the testing of recent piece of work and share a few tips on how to use Minion.

When I picked up this piece of work I was tasked with refactoring and updating a large area of code related to the UI, presentation and data access of a calculator widget. The internals were already heavily covered by unit tests – so I was happy I would not break any of the calculation logic, but I did need to be careful that I didn’t feed the wrong data into these various modules and that I hadn’t crossed any wires so to speak.

Of course there are a number of ways of doing this – code based integration tests are fantastic, but for this example I thought I’d write a quick browser based test. The idea is that if I capture inputs and outputs from a UI perspective before I make any changes to the code I can quick validate that I haven’t broken anything.

Below is a test script, executed by Minion to test the calculator.

I didn’t have any way to distinguish textboxes (no unique classes, and dynamically generated Id’s by asp.NET). To work round this Minion can gather a group of elements:

i.e .calculationForm input returns an array of 2 inputs.

I can specify an index to determine which input from the group I want Minion to use as its context element – easy.

Another tip is that you could also use jQuery to achieve the same effect. The code:

jQuery(‘.calculationForm input:eq(0)’)

Will do exactly the same thing.

MINION /hand-dryers/airblade-db/airblade-db.aspx

INPUT .calculationForm input 1 “1”
INPUT .calculationForm input 2 “1”
SELECT .calculationForm select @100
CLICK .calculationForm .goldBtn

VERIFY .savingValue 1 “£716.84″
OR VERIFY jQuery(‘.savingValue:eq(0)’) “£716.84″
VERIFY .savingValue 2 “£706.84″
VERIFY .savingValue 3 “£701.27″