Getting list of tests from Test Explorer in VS

前端 未结 2 1295
难免孤独
难免孤独 2020-12-20 14:26

This is kind of a \"high level\"/simple question. I\'m trying to get just a list of all the tests that are populated in my Test Explorer in VS2012. I\'d like to compare it t

2条回答
  •  青春惊慌失措
    2020-12-20 15:21

    The exported playlist is in XML but I wanted a simple list. Here's a powershell script to strip off the XML syntax and print just the test names. I remove the namespace information from each test. If you'd like the full name, remove $index = $child.Test.LastIndexOf(".") and .Substring($index+1)

    [xml] $content = get-content C:\out.xml $children = $content.SelectNodes("Playlist/Add") foreach($child in $children) { $index = $child.Test.LastIndexOf(".") Write-Output $child.Test.Substring($index+1) }

提交回复
热议问题