Contributions
Re: TestExecute Application Error Window
Thanks Pradeep, but unfortunately we are unable to upgrade to TC8 because of licensing costs. Regarding the code snippet you posted, the problem is that when trying to fire up a second copy of TestExecute it finds that there is already one open (the one stuck on the memory error screen) and so automatically closes as you can only have one instance open at a time. Therefore the script to close the error message doesn't actually get executed. Unless I am missing a command line parameter or configuration option which can let you run more than one instance, I don't think this code will work in our case.1.2KViews0likes0CommentsRe: TestExecute Application Error Window
Hey. Sorry to dig up an old thread, but was there ever a resolution found for this problem? We are getting the exact same error message (except the second memory address is different), and it is occurring when TestExecute attempts to close after performing a test run. It doesn't happen every time, but usually once in every 20 test runs. We're running TestExecute version 7.51.667.11, on a Server 2003 virtual machine. If you need me to supply more information just let me know. Chris1.2KViews0likes0CommentsRe: Stop Watch string object
You can get the elapsed milliseconds from the StopWatch.Split() and StopWatch.Stop() methods. JScript: function StopWatchTest() { var stopWatch = HISUtils.StopWatch; stopWatch.Start(); Sleep(1500); var startTime = stopWatch.Split(); Sleep(2000); var endTime = stopWatch.Stop(); Log.Message("Start time: " + startTime + "ms"); Log.Message("End time: " + endTime + "ms"); Log.Message("Duration: " + (endTime - startTime) + "ms"); }1.5KViews0likes0CommentsRe: Stop Watch string object
If you're using that Excel sheet just to manually view the values which TC has output, then you can change the cell formatting in Excel by going to Format -> Format Cells... (keyboard shortcut "Ctrl + 1"). On the "Number" tab choose the "Custom" option, and then on the right in the "Type" textbox enter: hh:mm:ss.000 Then click OK and it should appear correctly on the spreadsheet.1.5KViews0likes0Comments- 1.5KViews0likes0Comments
Re: Help in aqfile.exists(filename)
Try something like this: JScript: function FileCheck() { var regEx = /_fname_lname_[0-9]{2}_[0-9]{2}_[0-9]{2}.extn/ig; var folder = "C:\\"; var fileString = ""; var hoursMins = aqDateTime.GetHours(aqDateTime.Now()) + "_" + aqDateTime.GetMinutes(aqDateTime.Now()); var matchFound = false; var files = aqFileSystem.GetFolderInfo(folder).Files; for (var i = 0; i < files.Count; i++) { fileString += files.Item(i).Name + "\r\n"; } // Perform search operation var matches = fileString.match(regEx); if (matches != null) { // Iterate through Matches array for (var i = 0; i < matches.length; i++) { if (aqString.Contains(matches, hoursMins, 0, false) > -1) { Log["Message"]("These files matched: " + matches); matchFound = true; } } } if (!matchFound) { Log.Message("No matches"); } }893Views0likes0CommentsRe: Error in step that has a function call
You could try wrapping your function call inside a log folder. The error message from within that function call would tell you what went wrong, but to navigate to the originating function you'd double-click on the log folder in the log rather than on the actual error message, if you see what I mean. JScript: Log.Append("Test case 1..."); OtherFunction(data); Log.PopLogFolder(); Log messages in "OtherFunction" will be grouped together. If you double-click the "Test case 1..." item in the log it takes you back to the code above, rather than the bit inside "OtherFunction" where the error occurred.971Views0likes0CommentsRe: How to automatically copy and rename the MHT log generated by TestExecute?
I use the same method which Madhi has suggested: JScript: function GeneralEvents_OnStopTest(Sender) { var logFolder = "C:\\Logs\\"; var mhtName = "log.mht"; if (!aqFileSystem.Exists(logFolder)) { aqFileSystem.CreateFolder(logFolder); } var currentdateTime = aqDateTime.Now(); var dateTimeFolder = aqDateTime.GetYear(currentdateTime) + "_" + aqDateTime.GetMonth(currentdateTime) + "_" + aqDateTime.GetDay(currentdateTime) + "_" + aqDateTime.GetHours(currentdateTime) + "_" + aqDateTime.GetMinutes(currentdateTime) + "_" + aqDateTime.GetSeconds(currentdateTime); Log.SaveResultsAs(logFolder + dateTimeFolder + "\\" + mhtName, lsMHT); } (On a different note, how do you post code in a sensible block when you reply?)1.2KViews0likes0Comments