简体   繁体   中英

How to fix time out issue with C# selenium continuous integration build on TFS server?

I am setting up my C# selenium continuous integration build to run on TFS server

The build job has multiple stages:

  1. Initialize job
  2. Get sources
  3. Build Solution ***.sln
  4. VsTest - testAssemblies
  5. Kill Stray ChromeDriver
  6. Post-job: Get Sources
  7. Finalize Job

All these stages passed except VsTest-test Assemblies It always says "Build partially successed" and throws the following error

"##[warning]Windows Error Reporting DontShowUI not set, if the windows error dialog pops-up in the middle of UI test execution than the test will hang"
"##[error]The task has timed out."

I am not sure if these two errors are related or not But it always timeout, I have tried to add TearDown method in each of my classes and it still doesn't help

 [TearDown]
public void BaseTearDown()
{
    driver.Close();
}

According to your description, the vsTest task showing as "Partially succeeded" may due to you checked "Continue on error" option.

Continue on error (partially successful)

Select this option if you want subsequent tasks in the same job to possibly run even if this task fails. The build or deployment will be no better than partially successful. Whether subsequent tasks run depends on the Run this task setting.

Please refer to this document for more info: Task control options

Based on your warning and error, VsTest task has a timeout option which specifies the maximum time, in minutes, that a task is allowed to execute before being canceled by server.

在此处输入图片说明

Change the value to 0. A zero value indicated an infinite timeout.

If you still get the same error, the time out error should be caused by the hang of your test.

For this, there are multiple reasons, make sure you have installed all and need nuget packages.

You could take a look at our official tutorial here: UI test with Selenium

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM