Ankit
Ankit

Reputation: 11

Coded UI test are failing when Azure VM is not connected using RDP

I am trying to trigger Coded Ui test cases on Azure VM using VSTS pipeline(using Run Functional Tests task)

I am encountering a problem that when my RDP is not connected all my test are failing but when RDP is connected test are showing expected results

In my test there is no UI interaction, these test are to do with file processing by web jobs

I am only using Coded Ui test assertions for failing or passing the test cases

Upvotes: 0

Views: 226

Answers (1)

Ryanman
Ryanman

Reputation: 880

Any CodedUI test will fail if you try and run it while the desktop is locked. Essentially you'll have to do one of two things:

  • Use a different test framework if you actually use no UI interaction. Even just the normal MSTEST framework will function.I'm curious as to why you need to use CodedUI if you're not testing any UI at all.
  • Configure your Azure VM to automatically login using this utility: https://technet.microsoft.com/en-us/sysinternals/autologon.aspx . Once you restart the VM, your tests should work. However if you ever remote back in and then log out, your VM will lock its "screen" and you'll be unable to run UI tests until you reboot it again.

Upvotes: 1

Related Questions