Home > service-is-programming, service-is-testing > PowerShell Script to convert your Testing Anywhere run logs into a Excel pivot table data source

PowerShell Script to convert your Testing Anywhere run logs into a Excel pivot table data source

    1. 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,
    2. 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:
      1. Any oft-failing scripts should be put last during the daily run? how about length script needs to run?
      2. Any failing  script parts could be modularized and during the daily run? rlgx-excel-pivot-scripts-avg-duration-percentage
      3. any oft-failing scripts? E.g. here the top 8% of failing scripts have almost 30% of the errors. image
      4. Any oft-failing approaches that might benefit from refactoring? Starting with which  scripts? Main actions, then sub-actions:rlgx-excel-pivot-scripts-error-type-countrlgx-excel-pivot-scripts-error-type-count
      5. etc.
    3. Then this PowerShell script may help which
      1. extracts the non binary <runlog> items out of the binary rlgx files,
      2. and merges them into a single file
      3. 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 
  1. Make this PowerShell script a Scheduled Task,
  2. So that you can auto-update said XML which you made the  data source for your Excel monitoring/planning work book.
    1. 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 Smiley .
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: