Contributions
Jtree loading
I am working with JTree object and using the ClickItem method to click on a particular tree node. My question is that, if the node is not found, TC throws error. However, when i open my application, it takes a bit of time to load the tree nodes. While the tree is loading, if i use ClickItem, TC throws an error saying that the object was not found. Once the tree is loaded fully, the command works fine. I want to know how can i tackle this situation. Can i use a loop: Do Call Aliases.Java_Explorer.Explorer_Main.SwingObject("ExplorerFrame$4", "", 0).SwingObject("null.layeredPane").SwingObject("null.contentPane").SwingObject("YPanel", "", 0).SwingObject("YPanel", "", 0).SwingObject("YSplitPane", "", 0).SwingObject("YSplitPane$InternalSplitPane", "", 0).SwingObject("YSplitPane", "", 0).SwingObject("YSplitPane$InternalSplitPane", "", 0).SwingObject("ExplorerFrame$2", "", 0).SwingObject("YScrollPane", "", 0).SwingObject("JViewport", "", 0).SwingObject("ApplicationScreenSelector", "", 0).SwingObject("Tree").ClickItem("App|Viewers|Stores|Report1") Until <no error is thrown>11KViews0likes1CommentRe: Issue with FindChild method of TestComplete 8
Make sure that all the "parents" of the desired object are uniquely identifiable. If not, then you may have to break up the FindChild method: Set rootParent = <parent object> Set childParent = rootParent.FindChild(uniquely identifiable criteria) Set childChildParent = childParent.FindChild(uniquely identifiable criteria)589Views0likes0Comments- 772Views0likes0Comments
- 639Views0likes0Comments
Run functions from various scripts
I have created 10 script files and all of them contains one subroutine (commonly named as Run_This in all 10 scripts). I have crated another script file which references to all of these scripts (using USEUNIT). Now I want to run them in a sequence - so the script will look something like the following: Sub Main() Call Unit1.Run_This .... .... .... Call Unit10.Run_This End Sub So except for the script file names, the command is same. Is there a way where I can run all these scripts in a loop -- something like: For i = 0 to 9 ' ScriptFileName = "Unit" & i ' Call ScriptFileName.Run_This Next13KViews0likes2CommentsRe: Fire events when Jtable cell is clicked
To select column, simply click on the item from Available columns list. This will enable the [>] button. Click it to move the selected item to Selected column list. Please refer to the screenshot (in earlier post). Here is a sample code: sub test() Dim arrayProperties, arrayValues, availableColumns, selectedColumns, leftMoveButton, rightMoveButton, closeButton, ctr, aCol 'Captute all relevant objects on the dialog box arrayProperties = Array("JavaFullClassName", "AWTComponentName") arrayValues = Array("com.swing.table2.BaseTable", "nonFrozenTable") Set availableColumns = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,arrayProperties,arrayValues,25) arrayProperties = Array("JavaFullClassName", "Name") arrayValues = Array("com.swing.table2.BaseTable", "SwingObject(""BaseTable"", """", 0)") Set selectedColumns = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,arrayProperties,arrayValues,25) Set leftMoveButton = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,"AWTComponentAccessibleName","<",25) Set rightMoveButton = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,"AWTComponentAccessibleName",">",25) arrayProperties = Array("JavaClassName", "AWTComponentAccessibleName") arrayValues = Array("YButton", "Close") Set closeButton = Get_Object_By_Property(Aliases.JAVA_Explorer.TableColumnChooser,arrayProperties,arrayValues,25) 'selectedColumns.selectAll() 'Move required columns to selected columns Call closeButton.doClick end sub Note in the highlighted code - here the application throws NPE. I tried to simulate user click on the table, but again it threw NPE. The reason being, when selectAll is used via our script, the application fails to enable the MoveUp or MoveDown button (refer to screenshot)1.4KViews0likes0CommentsProject's structure on hard disk
1- The project explorer in TC displays the various elements in a tree. This is neat. However, this tree is only logical. The same files are not stored in that exact structure on the hard disk. Currently, I have to manually create the desired folder structure, move the required script/keyword files in them, and then use "Add Existing Item" feature to add those files in my projectsuite. I want to know, is there an option in TC which saves the folders and files in the structure made in the project suite? Take a look in the attached GIF. The folder structure like "Function_Library", "Root", etc. 2- Another problem is the size of NameMapping file. Currently, I have mapped only 3 objects and yet the size is 23MB. Can this be reduced?14KViews0likes3CommentsRe: Fire events when Jtable cell is clicked
Thanks. However, my problem is little more complex. Let me give you an example - There is a dialog box which have 2 single column tables (named available columns and selected columns). The first table contains a list of names - which can be moved to selected columns table. Now assume that the selected column table is currently empty and I move 3-4 columns from first table. When i click on the selected columns table, it throws NPE. The reason being - when the selected column table is populated, two buttons (move up and move down) are supposed to be activated (they are used to re-arrange the selected column list). Please see the attached screenshot. The basic problem is that these buttons are not getting the notification of getting enabled. I want to emulate the manual clicking of the table so that all the events/notifications are fired correctly.1.4KViews0likes0CommentsRe: Map "java" object in case of multiple java applications are open
I think I've found a way. I used Conditional Mode and used the CommandLine property to distinguish both the java processes. In the commandline property, i used wildcard (*). Property Condition Value ProcessName Equals java AND CommandLine Equals *Management Kit* Property Condition Value ProcessName Equals java AND CommandLine Equals *Explorer* Is this the right way or should I try something else to be "sure"?775Views0likes0Comments