Contributions
Issue with Name mapping and Window is invisible
Hello, I get error message "The 'DISPLAY SETUP' window is invisible and thus cannot be activated" even though the required window is available and active. This message does not come when first time the application is launched and the selected radio button is clicked from main screen of the application. But if I try to click on the radio button directly from main screen in subsequent attempts (Application is already launched and only setup is selected), I get the above error message. Also this message does not come if I do not use Name Mapping. That is I do not get the error if I use following code: Sys.Process("javaw").SwingObject("ad", "SETUP WINDOW", -1, 1).SwingObject("JRootPane", "", 0).SwingObject("null.layeredPane").SwingObject("null.contentPane").SwingObject("JPanel", "SETUP WINDOW", 0).SwingObject("JRadioButton", "DISPLAY SETUP", 0).ClickButton(); But in case I use use name mapping that is created automatically by the script, I cannot get going. Here is the problem code which works only for the first time when the application is launched. The name mapping is done automatically by the script. Aliases.Sys.java1.dialog01.RootPane.null_layeredPane.null_contentPane.Panel.RadioButton1.ClickButton(); Please suggest.16KViews0likes1CommentStop using Name mapped objects
Hello, How do I stop recording with name mapped objects? I would like to use full names without name mapped object names. I know initially it asks for name mapping, but I could not see option to disable this in future recording without deleting already existing name mapping. Regards, Mahesha20KViews0likes1CommentChecking Tooltip
Sir, I have one difficulty in checking the tootip. I am able to hover the mouse pointer over the command button from test complete and it does show the tooltip window. But how do I read the tooltip window propertiey? I do not know the window name of the tooltip window and I will have to read from script only. The moment I remove the mouse pointer, tool tip vanishes. So I am not sure how to test for tooltips.17KViews0likes4CommentsRe: Reading table values and comparing
Thank you for the reply. I know I am comparing the value itself. I gave only as an example just to show the problem I am getting with Trim. In real test, entire table values will be read first and stored in an array and compared after doing certain operations on the application to see that table values are changed or not changed. I have gone through the use of Tables property. But I have one confusion. My table is not static. Value get changed during run time. Also it is not one table. I have an array of tables. That means I need to create an array of table object (If there is a provision) something like below: myTableArray=new Array(); for(i=0;i<10;i++) // Create 10 tables myTableArray=new Tables.myTable() How to do this? Here is my code outline look like: for(myIndex=0;myIndex<10;myIndex++) { Read the present values of the table and store in my TableArray[ myIndex] Do certain operation in the application. Verify that the table values are changed as per the need. } In the above case, I end up in creating and storing 10 table objects. Please suggest if there is a method to do this. Regards, Mahesha1KViews0likes0CommentsReading table values and comparing
I have an issue with comparing the values from a table (Reading one value at a time from table Dynamically). I use Java script. Here is the Code for reading one value from second column in a table: function test10() { var tableIndex=59; HeaderTableAddress=Aliases.MainProcess.SwingObject("ea", "Dicom Tag Information", -1, 1).SwingObject("JRootPane", "", 0).SwingObject("null.layeredPane").SwingObject("null.contentPane").SwingObject("JPanel", "", 0).SwingObject("JScrollPane", "", 0).SwingObject("JViewport", "", 0).SwingObject("JTable", "", 0); var value=HeaderTableAddress.wValue(tableIndex,2); if(value!=HeaderTableAddress.wValue(tableIndex,2)) { Log.Error("Failed Expected Value = "+value+" Actual = "+HeaderTableAddress.wValue(tableIndex,2)); } } When I run this code, I get the failure. But values are correct as displayed below: Failed Expected Value = 20091220 Actual = 20091220 So I used Trim. var value=Trim(HeaderTableAddress.wValue(tableIndex,2)); It works fine as long as there is no Null characters in the table. When null character is encountered, I get error message: Trim. Could Not convert variant of type (Dispatch) into type (String) So what is the solution? Q1. How to read and compare table values without using Trim (Note that table contains strings as well as numbers) Q2. How to use Trim when there is a null?18KViews0likes5CommentsRe: Storing Object references in global variables
I started using the name mapping feature. Now I have new problem. Sometimes Objects are getting recognized only if I launch the application under test afresh for working with even child windows. If directly open a child window and run the scripts, I get the error message :The window is Invisible and cannot be activated. But if I navigate to the same child window after launching application from script itself, things work fine. So I ended up in modifying many scripts to close and reopen the application afresh. Is there any dependency or settings we need to make to work with name mapping without restarting the application? I think I am in soup now. I have scripts with mapping and without mapping (older one). Few of the scripts without name mapping does not work. Can both coexists or I will have to change all of the older scripts to consider name mapping?1KViews0likes0CommentsRe: Array of Class Objects
Continuation of this same thread: I have declared new object as: var myObject=new Object(); myObject.property1= something; myObject.property2= something; Now I want to create an array of myObject type. var myObjectArray = new Array(); How do I create each array elements? I tried as below , but seems to be having problem. myObjectArray [0] = myObject; myObjectArray [1] = myObject; How we have to create each array elements? Do we need to say something like: myObjectArray [0] = new (myObject) Note that the class is not created using ODT. Object is directly created.874Views0likes0Comments- 874Views0likes0Comments
Array of Class Objects
I would like to know how to create an array of class type. I have defined ODT class named "TextFieldClass" with two properties property1 and property2 To create an object of this class, I use ODT.Classes.New(" TextFieldClass"); Then I initialize each class items. Ex: myObj=ODT.Classes.New(" TextFieldClass"); myObj.property1="My Name"; myObj.property2="My Address"; But I want to create an array of type TextFieldClass. I could not find a direct method. I used indirect method: var myArrayObj= new Array(); // Create 5 objects of TextFieldClass type for(var count=0;count<5;count++) { myArrayObj[count]=ODT.Classes.New(" TextFieldClass"); } // Now initialize individual elements as required. myArray[0].property1= "Name1"; myArray[0].property2' "Address1" myArray[1].property1= "Name2"; myArray[1].property2' "Address2" Though this worked fine, I want to know if we have any direct way of defining array of objects something like: var myArrayObj=new Array(ODT.Classes.New(" TextFieldClass")); Alternate method could be (I did not try) to create another class and define new arrayObject of first type inside this second class!!! (Note: Above code may have few errors, it is not compiled one. Only shows the concept)16KViews0likes4Comments