Archive
Archive for January, 2016
PowerShell Script to convert your Testing Anywhere run logs into a Excel pivot table data source
2016/01/28
Leave a comment
- If confronted with a sizable Testing Anywhere test script codebase which has been marginally, but not substantially enhanced/cleaned up in several years while producing a barrage of automation errors daily,
- you may find that the run suite errors that Testing Anywhere logs automatically in its rlgx files are your best data source for monitoring and designing a plan of attack:
- Any oft-failing scripts should be put last during the daily run? how about length script needs to run?
- Any failing script parts could be modularized and during the daily run?
- any oft-failing scripts? E.g. here the top 8% of failing scripts have almost 30% of the errors.
- Any oft-failing approaches that might benefit from refactoring? Starting with which scripts? Main actions, then sub-actions:
- etc.
- Then this PowerShell script may help which
- extracts the non binary <runlog> items out of the binary rlgx files,
- and merges them into a single file
- which it wraps with an XML declaration and root level node that Excel can work with.
add-content -value '' -path C:\td\testinganywhere\files\rlgx\all-a-rlgx.xml -Encoding UTF8 Get-childitem -path C:\td\testinganywhere\files\rlgx\arnold-pc1 | ? {$_.Extension -eq ".rlgx"} | % { $file = convertto-string $_.FullName $match = [regex]::Match($file,'\s+(.*)\s+',"SingleLine,IgnoreCase").value add-content $match -path C:\td\testinganywhere\files\rlgx\all-a-rlgx.xml -Encoding UTF8 } add-content '' -path C:\td\testinganywhere\files\rlgx\all-a-rlgx.xml -Encoding UTF8
- Make this PowerShell script a Scheduled Task,
- So that you can auto-update said XML which you made the data source for your Excel monitoring/planning work book.
- The post-processing of the default error log messages that makes meaningful pivoting actually possible, is left as an exercise to the reader by Testing Anywhere
.
- The post-processing of the default error log messages that makes meaningful pivoting actually possible, is left as an exercise to the reader by Testing Anywhere
Categories: service-is-programming, service-is-testing
MS-Excel, ms-powershell, pivot-tables, rlgx, testing-anywhere, XML