Contributions
Re: Call function from another project
djadhavThanks again. Yes it is a same application and i am populating different windows from the main window. The only reason why i tried 2 projects method is : As i automate more and more windows to populate, it's hard to maintain Objects in nameMapping and also, project becomes so big that it takes a while to even open it. I will try to identify objects dynamically thru code. Can you show me an example of vbcode that identifies objects based on some properties such as titles (of the windows) or any other good properties that i can use. i am looking into findchild methods as well. Thanks, Vik2.2KViews0likes2CommentsRe: Calling function from another project
NisHeraMany thanks for your reply.The only reason why i am doing all this is this - If i keep everything in one project my Object Repository (NameMapping) becomes quite large and then i start having issues like : - object identification - Project takes 4-5 minutes to open. The application is based on JAVA Swing objects. I have to populate different windows from the main windows and it's hard to specify properties to all the windows so that no object identification issues occur (or i am not good at object identification techniques). So, i thought keeping different scripts in different projects means - every script will use its own NameMapping and will have no conflicts of object identification. But i guess, that's not right. Even if i refer any script from projectB from ProjectA, it would still use NameMapping of ProjectA. Any other solution to this problem? I am going to try merging of NameMapping with different configurations though. Thanks for your time. -Vik2.8KViews0likes0CommentsRe: Call function from another project
djadhavThanks for your reply. The only reason why i am doing all this is this - If i keep everything in one project my Object Repository (NameMapping) becomes quite large and then i start having issues like : - object identification - Project takes 4-5 minutes to open. The application is based on JAVA Swing objects. I have to populate different windows from the main windows and it's hard to specify properties to all the windows so that no object identification issues occur (or i am not good at object identification techniques). So, i thought keeping different scripts in different projects means - every script will use its own NameMapping and will have no conflicts of object identification. But i guess, that's not right. Even if i refer any script from projectBfrom ProjectA, it would still use NameMapping of ProjectA. Any other solution to this problem? Thanks for your time. -Vik2.2KViews0likes4CommentsRe: Calling function from another project
i have a realted issue: I have tried both the methods to call a function from another project. Call goes fine but script execution fails due to object not found error. How would i make use of the NameMapping objects that belong to Project 2. To make it simple: ' Unit A has a reference for unit B 'Unit A is in Project A 'call is from unit A to --> sub B of unit B Unit A 'calling sub B from unit A (below statement) unit B.Sub B ------------------------------- 'Unit B is in a Project B and has its own Namemapping. Unit B Sub B ' here obj_B is getting used. end sub Here is the issue: NameMapping for Project A has something like: Aliases.Process_A.obj_Parent.obj_A NameMapping for Project B has something like: Aliases.Process_A.obj_Parent.obj_B The script tries to find obj_B in the NameMapping for Project A which is what causing it to fail. How would i make sure that obj_B should be found in NameMapping of Project B? Please note that if i execute Sub B from project B on its own (without calling it from Proj A) then it passes without any issues. Please help. Many thanks. -vik2.8KViews0likes2CommentsRe: Calling Method from different PROJECTS in the same SUITE
i have a realted issue: I have tried both the methods to call a function from another project. Call goes fine but script execution fails due to object not found error. How would i make use of the NameMapping objects that belong to Project 2. To make it simple: ' Unit A has a reference for unit B 'Unit A is in Project A 'call is from unit A to --> sub B of unit B Unit A 'calling sub B from unit A (below statement) unit B.Sub B ------------------------------- 'Unit B is in a Project B and has its own Namemapping. Unit B Sub B ' here obj_B is getting used. end sub Here is the issue: NameMapping for Project A has something like: Aliases.Process_A.obj_Parent.obj_A NameMapping for Project B has something like: Aliases.Process_A.obj_Parent.obj_B The script tries to find obj_B in the NameMapping for Project A which is what causing it to fail. How would i make sure that obj_B should be found in NameMapping of Project B? Please note that if i execute Sub B from project B on its own (without calling it from Proj A) then it passes without any issues. Please help. Many thanks. -vik1KViews0likes1CommentRe: Call function from another project
Hi Dmitry_Nikolaev, I have tried both the methods to call a function from another project. Call goes fine but script execution fails due to object not found error. How would i make use of the NameMapping objects that belong to Project 2. To make it simple: ' Unit A has a reference for unit B 'Unit A is in Project A 'call is from unit A to --> sub B of unit B Unit A 'calling sub B from unit A (below statement) unit B.Sub B ------------------------------- 'Unit B is in a Project B and has its own Namemapping. Unit B Sub B ' here obj_B is getting used. end sub Here is the issue: NameMapping for Project A has something like: Aliases.Process_A.obj_Parent.obj_A NameMapping for Project B has something like: Aliases.Process_A.obj_Parent.obj_B The script tries to find obj_B in the NameMapping for Project A which is what causing it to fail. How would i make sure that obj_B should be found in NameMapping of Project B? Please note that if i execute Sub B from project B on its own (without calling it from Proj A) then it passes without any issues. Please help.2.2KViews0likes6CommentsRe: Trying to implement classes in my scripts.
The solution is: In every script (unit) just make a function that returns a reference to that class and call that function from any other unit to make use of that class. Unit A Class A End class Function GetClassARef(obj A) objRef = new Class A GetClassARef = objRef End function Call above function from any other script. Thanks.1.7KViews2likes1Commentunable to click on a button after Finding it
Hi, I am just trying to click on a button (Search button) that is a swing control. Please see the attached screen shot for its properties. No matter what i do, TC is unable to find it and reports in logs that "Unable to obtain the item's rectangle." Please see the screen shot of the error log as well. Following is what i am doing: PropArray = Array("JavaFullClassName", "AWTComponentAccessibleName", "text") ValArray = Array("javax.swing.JButton","Search", "Search") set objClearbutton = sys.Process("XXX").FindChild(PropArray, ValArray , 10, Refresh) Log.Message objClearbutton .Name 'working fine and returning me the name of the object. Call objClearbutton .ClickButton ' throws error (can't we call the methods of the object like that?) I would really appreciate your inputs. i want to make use of Find, Findall, find children etc in order to have robust object identification during test runs. Currently i have all the objects in the namemapping and time to time we face issues in object identification during test runs. Please pin point me to any source which could give me insight. I see some examples provided but for web. I have already tried to get the X,Y cordinates for the button object. Please help.1.3KViews0likes1CommentObject identification issues -Swing controls
Hi, I am having a strange issue while trying to play back my recorded scripts on the Javax.Swing Controls. When i try to playback recorded script, object issues arise and on inspecting name mapping, i see that simple swings buttons are not recoginized. for eg, when i recorded i used a following property : javaFullClassName = javax.swing.jButton but when i am inspecting TC is telling me to update the value for the property to java.awt.textfield So, TC actually is mixed up between some textbox, i guess and telling me to change the value to javaFullClassName =java.awt.textfield Even properties likeAWTComponentAccessibleName is blank at run time but during recording, the value was Search (it is a search button). Also, please let me know if there is a way to find controls dynamically without adding them to the namemapping. I am looking for some detailed examples of Find , FindAll methods approach. Thanks,852Views0likes0Comments