Error TF260948 when upgrading the agent in Lab Center (MTM)

If you upgrade Team Foundation Server environments very often, you sometimes forget how counter-intuitive some upgrade procedures are and perform them on the auto pilot. Today I had an upgrade of a lab management environment to an update of TFS 2012. Part of that upgrade is to upgrade the lab management agents.Upgrade please

This is quite simple as one upgrades the test controller and selects the “Upgrade agent” on the environment in MTM or use the upgrade agents button in the messages about the environment. After entering ones credentials, this usually goes right. However if Coded-UI tests are configured this results in the following error message:

“Microsoft Test Manager could not complete the following action: Validating the user name and password for coded UI tests.

Additional information: TF260948: The user name or password provided to configure the test agent to run as a process are not valid.

Error code: 1326”

The usual response of people who didn’t read the error message correctly is to try it again. They think they mistyped their password incorrect and become frustrated when it’s rejected again. The key hint here is the part: “Validating the user name and password for coded UI tests.” During the upgrade of the test agent that runs the coded UI tests, the test agent is re-installed. Because the test agent is re-installed, both the username and password are needed of the coded UI account, however due to security reasons MTM doesn’t retrieve the password or stores it.UI Tests

One needs to set the credentials used for the coded UI tests again. This can be done by opening the environment and setting the credentials for the Coded UI tests under Advanced. After pressing; verify and finish, re-try the same upgrade action in the same go without closing MTM or opening a different environment.