Forum Discussion

BBK's avatar
BBK
New Contributor
8 years ago

/exportLogToXMLAlso switch in commandline

Hello,

We have upgraded from version 10.60 to 11.31.

All of our other scripts work as before except the Get current Log Items method which we used the sample here to write it :

https://support.smartbear.com/viewarticle/9047/?q=​xDoc.load%28tempFolder+++%22root.xml%22%29%3B#_ga=​...


This script works when using the switch /exportLogToXMLAlso to start TestComplete or TestExecute using the UI; however, it does not run when we try to run the tests via command line using the switch /exportLogToXMLAlso

 

It is pointing to this part of the code and Object required error for ( if ("LogData" != logData.nodeName) ) as root.xml cannot be found as if the switch /exportLogToXMLAlso was not passed in.

Here is the command line:

TestExecute.exe C:\_LOCALDATA\Test\Test.pjs /p:BuildVerification /t:"NetworkSuite|Jobs|BuildVerification|BV" /run /ExportLogToXMLAlso /SilentMode /exit

 

Is the above correct? Are we missing something?

 

Here is our code which works when running via UI

 

if (Log.SaveResultsAs(tempFolder, lsHTML)) {

var xDoc = Sys.OleObject("MSXML2.DOMDocument.4.0");

xDoc.load(tempFolder + "root.xml");

var logData = xDoc.childNodes.item(1);

 if ("LogData" != logData.nodeName)

{

Log.Error("Unable to get information on the current test run.");

return;

Any help is greatly appreciated.

Thanks

No RepliesBe the first to reply