Santhosh
Santhosh

Reputation: 761

Run Functional Tests task fails with error "The agent process was stopped while the test was running"

The Coded UI test cases executed with Run functional tasks exit with the following error message: "The agent process was stopped while the test was running." These test cases were executed successfully before and the error description is not clear to investigate further and resolve the issue. Could you please share some information on the root cause and the probable solutions for the same. Thanks in advance.

Error message:

[error]System.Exception: Some tests in the test run did not pass, failing the task.

Environment Details: TFS on-premises , TFS 2017 15.112.26307.0 (Tfs2017.Update1)

Build Agent : Private, OS: Windows Server 2012 R2, build agent version : 2.112.0

Test Agent : Private, OS: Windows 10

Test deployment task version: vstf_testagent.exe version version 14.0.23107.10

Upvotes: 0

Views: 1107

Answers (1)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30432

According to the error message "Some tests in the test run did not pass, failing the task." In your test log you should see something like this :

Test run '5262' is in 'InProgress' state.
2017-03-22T09:04:32.3083813Z DistributedTests: Please use this link to analyze the test run : xxxx

You can navigate to the Test Runs in the Test Hub to get more info for further troubleshoot.

The root cause should be that :

Automation engine is unable to playback the test because it is not able to interact with the desktop. This could happen if the computer running the test is locked or it’s remote session window is minimized.

So, you can check if the test works with an open Remote Desktop session, if it works, it should exactly be the issue.

Solution:

To fix that and get better experiences you can install the Autologon tool,

This logs in the server automatically and creates the interactive desktop. But you do not need a remote desktop or something.

After installing the autologon tool, configure the tool to use the account to run the tests, and rebooted the server. Then try it again.

Reference this article: Run Functional (Coded) UI Tests in your VSTS Release Pipeline

Upvotes: 1

Related Questions