0

We have our web application, we created a automatic build for it on code checkin from visual studio and in Release definition we are deploying it to the remote iis server. Its getting deployed successfully. Now, we have coded UI test cases to run for testing the hosted application. Can anyone please help me that how we can run UI based functional test cases using VSO CD.

In Release definition, we added "Visual Studio Test Agent Deployment" but getting error

Invalid URI: The hostname could not be parsed.

  • How do you specify the machine(s) in Visual Studio Test Agent Deployment task? Do you use Hosted agent? Is test agent machine accessible from build agent machine? – starian chen-MSFT Jul 05 '17 at 07:14
  • Machine (servername.redmond.corp.microsoft.com). Now above error is resolved, but getting the below error >Error : System.Exception: Command execution stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Element not found. – manish tomar Jul 05 '17 at 08:37
  • Set system.debug variable to true, then queue build and post the detail error message here. – starian chen-MSFT Jul 05 '17 at 09:08
  • I tried by changing system.debug variable to true, build succeeded as before but getting the same error for Release definition: '##[error]Error occured on 'servername.redmond.corp.microsoft.com:5985'. Details : 'Command execution stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Element not found.' – manish tomar Jul 06 '17 at 07:40
  • Add system.debug variable to release definition, then start release and check the detail error. You can share the detail log on the OneDrive. – starian chen-MSFT Jul 06 '17 at 07:46
  • I tried. Please find the log here: https://microsoft-my.sharepoint.com/personal/v-mtomar_microsoft_com/_layouts/15/guestaccess.aspx?guestaccesstoken=2yNE%2b9JDgeqApbO86NjrpfZOGBDLp%2b%2fTOoOqNP94rvo%3d&docid=2_140f581fef21f4d14b35420945e262b95&rev=1 – manish tomar Jul 06 '17 at 12:26
  • Try to configure WinRM with this [PowerShell](https://github.com/Microsoft/vsts-tasks/blob/master/Tasks/PowerShellOnTargetMachines/ConfigureWinRM.ps1), try to do test with PowerShell on Target machine task and check the result. – starian chen-MSFT Jul 07 '17 at 01:39
  • Sorry for the late reply, Thanks Starain for this PowerShell but it's not executing successfully on the remote server. Following error is coming- Error number: -2147024891 0x80070005 Access is denied. Error: Save encoded certificate to store failed => 0x5 (5) Failed Failed to create the test certificate. At line:15 char:13 + throw "Failed to create the test certificate." + CategoryInfo : OperationStopped: (Failed to create the test certificate.:String) [], RuntimeException + FullyQualifiedErrorId : Failed to create the test certificate. – manish tomar Jul 13 '17 at 09:36
  • Now, if I am creating release then following error is coming: 'WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet.' – manish tomar Jul 13 '17 at 10:23
  • Do you have another machine? Based on the machine name, it seems that the machine has policy to limit WinRM. Which build agent do you use? Make sure your machine can be access from build agent machine. – starian chen-MSFT Jul 14 '17 at 01:40
  • Remote server is accessible.I am not able to download agent to configure.Now, another error is coming: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To run tests that interact with the desktop, you must set up the test agent to run as an interactive process. If you are running the tests as part of your team build, you must also set up the build agent to run as an interactive process. For more information, see "How to: Configure and Run Scheduled Tests After Building Your Application" – manish tomar Jul 20 '17 at 09:03
  • Check Interactive Process (1.*)/Run UI Test (2.*) option for Deploy TestAgent on task. – starian chen-MSFT Jul 21 '17 at 01:36
  • Now, Deploy Test Agent Task is working but getting an error in second task "Run Functional Test Cases". Same machine name is using. ##[error]System.InvalidOperationException: No matching test machines found. Check the machine filters provided in the task and ensure that Deploy Test Agent task was added prior to this task and it had passed. ##[debug]Processed: ##vso[task.logissue type=error;]System.InvalidOperationException: No matching test machines found. Check the machine filters provided in the task and ensure that Deploy Test Agent task was added prior to this task and it had passed. – manish tomar Jul 24 '17 at 10:58
  • What's the detail setting of Run Functional task? Share the detail build log (Deploy Test agent and Run Functional test) on the OneDrive. – starian chen-MSFT Jul 25 '17 at 01:41
  • Please find the log here:https://microsoft-my.sharepoint.com/personal/v-mtomar_microsoft_com/_layouts/15/guestaccess.aspx?guestaccesstoken=fyLsuG9ykneK15j%2fozrt29JM04Fv6fhGCmb9nGNkR98%3d&folderid=2_1369ff67ed692422996c5b3b8c99e6d29&rev=1 – manish tomar Jul 25 '17 at 04:56
  • You are using machine group in Deploy test agent task, try to change task version to 2.* and specify the FQDN (machine name with domain) then check the result. – starian chen-MSFT Jul 25 '17 at 05:37
  • Now, I am able to execute test cases on server. Disabled the screen saver and keep the session active while running the test cases. SO, its working fine. Thanks for your guidance Starain. – manish tomar Jul 25 '17 at 09:14

1 Answers1

0

Change the version of Deploy test agent task to 2.* and specify the FQDN (the same as Run functional Test)

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53