Forum Discussion
Import Test Steps via Excel Addin
Take this:
1. Force Plain Text Paste via VBA
Instead of manually pasting into each cell, use VBA to inject the XML string as plain text, bypassing Excel’s formatting engine:
Sub PasteAsPlainText()
Dim ws As Worksheet
Dim rng As Range
Dim xmlText As String
Set ws = ThisWorkbook.Sheets("YourTargetSheet")
Set rng = ws.Range("B2") ' Target cell for XML
xmlText = "<steps id=""0"" last=""2""><step type=""ActionStep"" id=""2""><parameterizedString isformatted=""true"">Open App</parameterizedString><parameterizedString isformatted=""true""></parameterizedString></step></steps>"
rng.Value = xmlText
End Sub
This ensures the XML is written as raw text, not as a formatted object.
2. Use Power Query to Inject XML
If you’re importing from another sheet, use Power Query to transform and load the XML strings as plain text. This avoids Excel’s automatic character escaping.
3. Pre-encode XML in VBA
If you must paste via cell copy, pre-encode the XML manually so DevOps interprets it correctly:
Function EncodeXML(xml As String) As String
xml = Replace(xml, "<", "<")
xml = Replace(xml, ">", ">")
xml = Replace(xml, """", """)
EncodeXML = xml
End Function
But this only works if DevOps is expecting encoded XML—which it usually isn’t for test steps.
4. Use REST API for Bulk Upload
If Excel is not a consideration, may switch to the Azure DevOps REST API method. You can batch-create test cases with steps using structured XML and avoid Excel altogether.