ContributionsMost RecentMost LikesSolutionsError Handling Failed Checkpoints Hey guys, I'm working on implementing error handling in my automated tests and I was wondering how other testers approach error handling when it comes to their scripts or keyword tests. I want to wrap my automated tests in a try-catch statement where the catch statement will launch a function that will refresh the tested application to a default state for the next automated test. function test1() { try{ *Perform Actions* Checkpoint() *Continue Performing Actions* } catch(e){ setTestApplicationToDefault() //continue to test2 } However, I found a tricky situation. When Test Completes checkpoints fail (regions, File, etc..), they will throw errors. In my mind, a failed checkpoint is not necessarily an error. I would like the automated test to continue to completion and I will examine the test log later. Thanks in advance! Limit Amount of Logs Kept by Time Frame Instead of limiting the number of logs kept by Test Complete by a count, it would be nice if it they could be limited by a time period. For example, keep the last Month of test logs. This would be useful for users who run a high volume of tests in a short amount of time, but would still like to keep their output logs under control and accessible. Re: Close Modal Windows Thanks for the response! This error prompt occurs unexpectedly when things are not going as planned! For example, the application is expecting to open a certain file type, such as a text file. However, due to an unexpected error in the script, it tries to open a .png file. The application launches its own error prompt that the script is not anticipating. Close Modal Windows Hey guys! I'm trying to figure out a way to close unexpected modal prompts during playback that originate from the tested application. I'm curious if anyone has had previous experience with this kind of problem. From what I understand, because the modal prompts originate from the tested application, TC's "unexpected window" won't work (or atleast it hasn't so far). I'd like implement it in a try catch statement: try{ test actions } catch{ closeModalWindows() refreshApplication() } I have two ideas for the closeModalWindows() 1. Use Find and get all windows in the application. Loop through each window and check its "isModal" property (which is a native java property of the window). If its modal, close it. 2. I'm reading Smartbears article on testing modal windows and I'm thinking about trying their approach, but confused on how it works. https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/modal-windows.html. Thought I'd ask before diving too far in! Seems like it would be a common problem. Thanks in advance! Finding Java Tags Hey Guys, I'm struggling to find a "Tag" property using native Java methods in Test Complete. I'm testing an application that uses Matlabs uicontrol methods and I can extract some properties, but not all. For example, for a textfield as written in the code: uicontrol('Style','edit',... 'Parent',Box,... 'Tag','uniqueTag',... 'Units','normalized',... 'FontSize',12,... 'TooltipString','exampleToolTip',... 'String',num2str(dimension),... 'BackgroundColor','w',... 'HorizontalAlignment','left',... 'Enable',true,... 'Callback',@callback) I can use native java methods from Test Complete to extract properties such as the actual text in the texfiled using "getText()" and even get the tooltip using "getToolTipText()". Since I can extract content such as the tooltip, I think I should be able to find the Tag. Is there a command or technique for this? I was curious if maybe this is a private property, but do not see it mentioned in the matlab documentation: https://www.mathworks.com/help/matlab/ref/matlab.ui.control.uicontrol-properties.html Note: Not sure if its applicable or not, but in order for Test Complete to recognize objects in the application, MSAA has to be enabled. Even with this enabled, a lot of properties are not discovered. Hence the native methods. Thanks in advance! Re: Sorting an Array Object from FindAll Hey Marsha_R, I think I just figured it out. By adding the .toArray command, the comSafeArray was converted to an array object and I can use the sort method. var tableArray = window.FindAllChildren("JavaClassName","UITablePeer$23",2000,true).toArray() var sortedTableArray = tableArray.sort(function(a,b){return a.Left - b.Left}) Now, the documentation for the FindAll and FindAll children does warn that JScript, C#Script and C++Script users need to convert using toArray(), but I did not think this applied to me since I'm coding in Javascript. Sorting an Array Object from FindAll Hey guys! I'm trying to figure out how to sort an array of objects by a certain property. However, I'm encountering an error where TC is saying "tableArray.sort is not a function". Code: const tableArray = window.FindAll("JavaClassName","UITablePeer$23",2000,true) var sortedTableArray = tableArray.sort(function(a,b){return a.Left - b.Left}) Now, I know that TC supports the .sort() method because this example line of code does work: const cars = [ {type:"Volvo", year:2016}, {type:"Saab", year:2001}, {type:"BMW", year:2010} ]; var sortedCarArray = cars.sort(function(a, b){return a.year - b.year}); My hunch is that there is a type difference between the tableArray and the cars array. In debugger, the cars array is a Array type whereas tableArray is a ComSafeArray. Could that be the reason for the discrepancy? I tried declaring the resulting object from FindAll as a new array and it was just indexed into an array! var tableArray = new Array(window.FindAllChildren("JavaClassName","UITablePeer$23",2000,true)) Thanks in advance! SolvedError Prompt When File or Region is not succesfully updated When using the "update checkpoint data" command from the test log, I found that if the file or region image is not writable (due to source control) then the file won't be successfully updated. Unfortunately, no prompt will appear informing the user that the file update was not successful. A prompt would be appreciated! Re: Custom Keyword Highligting Hello, So I think I answered my own question. While customizing font colors for text would be cool, its not really necessary. One thing I realized after reading javascript is that .arguments is actually a property of a function "object". As useful of a property as it is, theres not really a purpose for customizing text of a property. As for the Error() method, I believe that is a method that acts on a error object. Again, very little reason to customize a method declaration. I'll see if I can give myself a kudo. Custom Keyword Highligting Hey guys, Is it possible to add commands to the User Keywords list in Options > Panels> Code Editor? I'd like to highlight the arguments and Error commands in the code editor similar to other keywords such as throw or even Alias. Is there a way to do that? Thanks! Solved