Hi ,<\/p>\n
I have 2 xmls and it has the test results in it. So i want a final xml which captures the test1.xml and test2.xml. Below are my xmls<\/p>\n
$parentString = @\"
\n
\n
\n
\n<\/p>\n
\"@<\/p>\n
$childString = @\"
\n
\n
\n
\n<\/p>\n
\"@<\/p>\n
and Final XML should look like this<\/p>\n\n \n \n
I tried this below code but i am not able to sum up the tests and totaltime …Please help!!!<\/p>\n
$parent = [xml] (Get-Content ‘.\\Result.xml’)
\n$parentnode = $parent.testsuite.testcase
\n$child = [xml] (Get-Content ‘.\\Results.xml’)
\n$xpath = ‘testsuite/testcase’
\n$childnode = $child.SelectSingleNode($xpath)
\nWrite-Host(“So the child is $($childnode.OuterXML)”)
\n$importedNode = $parent.ImportNode($childNode,$true)
\nWrite-Host(“And after importing: $($importedNode.OuterXML)”)
\n$parentnode.InsertAfter($importednode, $parentnode.LastChild)
\nWrite-Host(“To finally yield: $($parent.OuterXML)”)
\n$parent.Save(“.\\Final.xml”)<\/p>","upvoteCount":5,"answerCount":10,"datePublished":"2020-05-18T09:01:21.000Z","author":{"@type":"Person","name":"monalisha","url":"https://community.spiceworks.com/u/monalisha"},"suggestedAnswer":[{"@type":"Answer","text":"
Hi ,<\/p>\n
I have 2 xmls and it has the test results in it. So i want a final xml which captures the test1.xml and test2.xml. Below are my xmls<\/p>\n
$parentString = @\"
\n
\n
\n
\n<\/p>\n
\"@<\/p>\n
$childString = @\"
\n
\n
\n
\n<\/p>\n
\"@<\/p>\n
and Final XML should look like this<\/p>\n\n \n \n
I tried this below code but i am not able to sum up the tests and totaltime …Please help!!!<\/p>\n
$parent = [xml] (Get-Content ‘.\\Result.xml’)
\n$parentnode = $parent.testsuite.testcase
\n$child = [xml] (Get-Content ‘.\\Results.xml’)
\n$xpath = ‘testsuite/testcase’
\n$childnode = $child.SelectSingleNode($xpath)
\nWrite-Host(“So the child is $($childnode.OuterXML)”)
\n$importedNode = $parent.ImportNode($childNode,$true)
\nWrite-Host(“And after importing: $($importedNode.OuterXML)”)
\n$parentnode.InsertAfter($importednode, $parentnode.LastChild)
\nWrite-Host(“To finally yield: $($parent.OuterXML)”)
\n$parent.Save(“.\\Final.xml”)<\/p>","upvoteCount":5,"datePublished":"2020-05-18T09:01:21.000Z","url":"https://community.spiceworks.com/t/appending-2-xml-test-results/762991/1","author":{"@type":"Person","name":"monalisha","url":"https://community.spiceworks.com/u/monalisha"}},{"@type":"Answer","text":"
If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n