We are running selenium E2E tests as part of VSTS Release. We're using Visual Studio Test task which runs vstest.console.exe as a NT AUTHORITY\SYSTEM user. How can we specify a different account?
Sorry, this could not be achieved for now. Please take a look at this thread: Test agent, Test Controller and MSTEST FAQ (Qustion 21), it should be also applied to VS test.
Will Test Agents allow you to impersonate another user? Or does the
Test Agent always kick of tests as the user its configured start up
as?
There is no built in support for impersonation, so by default tests
run under the identity of the test agent. If this is something you
really need, you could write a unit test extension that does the
impersonation for you.
We could not specify the user in the "Visual Studio Test" step, the test will running with the agent.
As a workaround, you can try to change the agent service account to the specific account of the user. Or just deploy a new agent to run with the specific account, a sample for your reference : Running Unit Tests on different machine during TFS 2015 build
Related
I have several test cases in TFS. I would like to run those test cases using MTM(Microsoft test manager) automatically and update the test results. How to connect or configure MTM with TFS so that I can automate all the test cases.
Connecting TFS from MTM is easy, just enter the TFS name or URL and choose your team project:
Details of Automate a test case in Microsoft Test Manager, check: https://msdn.microsoft.com/en-us/library/dd380741(v=vs.120).aspx
If you use TFS 2015.2 and later versions, then it's not needed to use MTM, you can use new build system and Run Functional Tests task to executing automated tests, check: https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/31/executing-automated-tests-in-build-vnext-using-test-plan-test-suites/
Our web application codes are stored on SVN instead with TFS. We are trying to set up our automated UI testing.
These are following tools our team are considered to use.
- Microsoft Test Manager (Create Test cases associate with User stories)
- Coded UI (Connect to TFS and Microsoft Test Manager)
- Selenium (Automated UI coded)
- Team Foundation Server 2015 (Test cases and User stories)
Web Application with URL
We only want to configure automated UI testing for our website. Is there any way to run the set up the automated testing without build through TFS?
Thank you and any feedback is appreciated.
So here is the thing,
Coded Ui is not a connector to TFS & MTM it by itself an automation
framework/tool like selenium
You don't need both Selenium & Coded UI for your automation. You only need either of it
If all you want is to get started with automation for your application, you can do it just with a version of visual studio which has Coded Ui. (The latest supporting version is Visual Studio 2015 Enterprise edition)
See this like to know How to create Coded Ui Tests , see this link to know how to Run a Coded Ui Test
It's based on your workflow. Whether your app/code is on-premises or in the cloud, you can automate build-deploy-test workflows and choose the technologies and frameworks, then test your changes continuously in a fast, scalable, and efficient manner. And just as Prageeth said, Coded Ui is an automation framework/tool just like selenium.
In TFS either code ui or selenium test more like continuous testing. The workflow is such as bleow:
First make sure that your app still works after every check-in and
build using TFS. Find problems earlier by running tests
automatically with each build. When your build is done, review your
test results to start resolving the problems that you find.
Add some related tutorials for your reference:
How to run Code UI in TFS: Executing Automated tests in Build vNext
using Test Plan, Test Suites
How to run Selenium in TFS: Get started with Selenium testing in a
continuous integration pipeline
If you insist on without building from TFS, you could also use the Code UI function with VS on local.
You can setup Test controller and Test Agent VMs in MTM test lab. This will allow you to execute your automated tests on Test Agent directly in MTM. Otherwise, you can execute Coded UI tests locally in Visual Studio.
my team is using Bamboo OnDemand and have a custom made Image built on the default image for Bamboo OnDemand.
We have some things in our build process which needs to be running in administrator mode.
How should I configure the machine?`
I can't find any windows service called Bamboo to run as administrator.
I have found the Bamboo user it runs under but it wont work if I add the user to the Administrators group
I did a bad thing and just disabled UAC.
When my CodedUi tests (VS 2012) are run as part of TFS build process, they are run under a BuildUser account. The BuildUser account is used to run builds.
I expected that given the Test Agent is running under a TestUser account, the tests too should be run under the TestUser account.
Is there are a way to run tests as a TestUser, even though the tests are run as part of a TFS build-deploy process?
Thanks.
When you are running your tests as a part of build the tests are run under the context of the build account. While there is no existing configuration such an ask you can achieve this via
Modifying the build process template to run the test activity under testUser cred
Schedule the run on a test controller which has an agent configured under the testUser cred. This can be done by specifying a .testsettings file with your tests in the build process template. The .testsettings UI in VS will allow you to point to a remote test controller.
When you run your tests as a part of the build-deploy-test workflow using labdefaulttemplate then the tests are executed on the environment in the context of the test agent which can be configured as a testUser
I was wondering if it is possible for Jenkins to be notified after TFS finishes a build.
I'm trying to make a system where, after the TFS build, Jenkins is used to run automated selenium tests.
Thanks in advance!
You have a few options:
You could use a GenericTest to trigger Jenkins and include as part of the Build Definition. This also allows your script to communicate pass/fail information back to the build.
You could just include an InvokeProcess workflow activity to trigger Jenkins. The process would be similar to this or this.
Or you could use a tool that would trigger after a Team Build has finished. Normally people would use tools that then deploy stuff. Most of these tools trigger a Powershell script at some point, which would allow you to trigger the test run:
Octopus Deploy
TFS Deployer