Results 1 to 7 of 7
  1. #1

    Identifying java object through TestComplete


    I am currently evaluating TestComplete for my java application and my application has a tree structure on the
    left hand side of the pane and whenever I expand the tree structure and select an item, the details will be shown on the right hand side of the pane.

    The problem is TestComplete recognises the items in the tree as X, y co-ordinates and not as an object.Since X & Y coordinates is not the proper way to identify the object, the script will not run if the X & Y coordinate changes and I am facing the same problem now.

    Is there a way, where TestComplete can recongnize all of them as objects and not as X & Y coordinates?


  2. #2

    Re: Identifying java object through TestComplete

    It probably won't as it generally does a poor job of recognition of items inside java objects like jtrees, jcombos, jtables etc.

    However, you can script some very simple procedures which will access the objects standard java methods, these will provide all the functionality you could ever need.

  3. #3

    Re: Identifying java object through TestComplete

    Hi Billh,

    Thanks for your comments.The script that you are referring here has to be added in the application side (which we are testing) or in the test complete tool ?

    Do you have some sample script to identify the standard java objects that need to identified

  4. #4

    Re: Identifying java object through TestComplete

    These functions and procedures will be scripted in testComplete and should form part of your testing framework ie their helper scripts outside of your actual test scripts.

    No examples to hand, but if you go to the object properties of the component you are interested in (in this case I guess its a jTree) then click the method tab, this lists all the java methods available to you, all of which you can invoke in TC, for example, maybe a contains(), getSelected, setSelected, things of this nature, again all of which you can use.

    I should add that the above also goes for non standard java objects.

  5. #5

    Re: Identifying java object through TestComplete

    Thanks Billh. I am not clear how to add and where to add the java objects in TestCentral so that it recognize the objects which it doesn't recognize before.

    It would be great if you could let me know the path in Test Central where we can dod this.


  6. #6

    Re: Identifying java object through TestComplete

    The first thing you need to do is get the object your interested in, for example a jtree: ie namegmapping.sys.java.rootPanel1.someotherpanal.my _jtree

    Now if you investigate the object properties of this you will find items that will help you use it, for example:

    * You may find some fields that contain the elements you want to select, you can return these to variables in your scripts, perhaps to do comparisons etc.

    * The way I usually work with java objects is to use its own methods, again contained in the object properties window. for example, there could well be a contains() method or a setSelected() method etc.

    As a hypothetical example in your test script you can do things like

    if namemapping.sys.java.rootPanel1.someotherpanal.my_ jtree.contains("ITEM I WANT TO SELECT") then
    namemapping.sys.java.rootPanel1.someotherpanal.my_ jtree.setSelected("ITEM I WANT SELECTED")
    end if

    OR maybe somthing like the following (returns an array of all elements)

    MyArray = namegmapping.sys.java.rootPanel1.someotherpanal.my _jtree.getAllItems()

    These are just random examples you will need to look at what methods are avalible to you in TC for the objects you want. I probably havent explained this that well, so if a mod/automated qa support guy wants to step in feel free [img]/images/graemlins/smile.gif[/img]

  7. #7

    Re: Identifying java object through TestComplete

    Hi Maniramdoss,

    Billh is correct: you should code the needed functionality manually using native methods and fields of the control in question. A script example has been recently posted to the TestComplete newsgroup:

    Irene - SmartBear Support



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:49 PM.

Copyright BetaSoft Inc.