Run selenium tests on remote machine from tfs

Hi guys, In my former company we created a framework (testNg +java) that used to start all our test cases on different machines.
Now I’m in a new company and we would like to make the same but via tfs, basically, we’d like to create a pipeline that build our tests and run them but on different remote machines (vm, physical or whatever)
My idea was to use agents but i read that they are not used anymore and this scenario may be created by using visual studio test but honestly i’m a bit confused

any idea or suggestion?

thanx

If you are using a recent version of TFS - 2017 or later - or using VSTS (which is now called something else I can never remember) this is relatively easy to set up.

The old style of agents using a controller has indeed been deprecated, and only really works for the Visual Studio load tests (requiring a controller using either 2015 or 2013, and the most recent 2013 version of 2013) if you have a modern TFS.

The way to do this with a modern version of TFS is a bit complicated, but it works.

You will need a machine that can act as the build server. This machine must have Visual Studio installed and licensed at the highest level of code you’re planning to build. If you’re intending to use features that require the full enterprise license, that’s the level of license your build machine install of Visual Studio needs. (The errors you get when VS lacks the correct license are not particularly helpful)

You will also need to be sure that the build server allows a TFS service local administrator access. Where I work, we’ve got a TFS service account that’s a domain level account and is part of the local admin account on our build server.

Every machine that is to run tests must be on the same subdomain as the build server, and must allow the TFS service account local administrator access. These machines need extra configuration to minimize problems: they need to be configured to never go to screensaver, and to automatically log on as the TFS service user when they restart.

Once you’ve got that set up, you need to go to the Settings icon in your TFS site, and set up your build agent. You’ll need to make sure the TFS service account has security for the build agent. You also need to download the agent to the build machine and install it the first time around.

The next big piece is to create yourself an access token that the builds can use for security. Make sure you save the token once you create it.

Once you’ve got all of this in place, you can go to the Build & Release tab and start creating your build/release pipeline.

It’s not all that difficult to do, but I strongly suggest you keep everything in debug mode until you get things running. I’ve found that the pipeline works really well, but it can be horribly frustrating setting things up at first. You can find a decent starting guide at Microsoft’s documentation repository - I’ve set up pipelines based solely on this information.

1 Like

thank you for the answer. where can i find infos about the steps i have to do to make my test machines available by tfs? that part is nto very clear
thanx

It’s different for each version of the Windows OS.

The basics are:

  • To make the domain-level TFS service account a local admin, on each machine you need to log in with a local admin level account, find the user and group management module, then open the Administrators group. Add the TFS account to the group and save.
  • To configure never going to screensaver, go into display settings (most likely from the control panel) and turn off screensaver and monitor sleep for all users. NOTE: If your employer has a group policy forcing screensaver and monitor sleep, you will need to work with your network management team to exempt those machines from the policy, and potentially edit group policy items as well. If so, a web search will give you ways to edit group policy.
  • To configure automatic logon, you will need to edit the registry. Detailed steps can be found here, starting about half way down the page.