SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Jul 2002
    Location
    Surrey, England
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Identifying fields in Delphi Application

    Up until now, the 'Parent' and 'Index' Significant Fields have been used successfully to distinguish different fields/objects in the application I have to automate testing for. For a particular screen that I am currently dealing with some object Index value vary, e.g. the Title field has an Index value which varies between 3 and 4 each time I open the application. I do not know how can this be as the layout of the screen does not change. And according to the statement in the QARun User Guide, the Index values for these screen objects should be the same each time the script is run or the Delphi application opened, i.e "The Index distinguishes between controls that have identical classes and titles. Indexes are allocated to these objects by position - in a top-left to bottom right order".

    The problem I have is that we have a number of objects with the same Class Name, Module, Type, Title, Parent Title and ZOrder. The ID value changes each time the Delphi application is opened so cannot be used. The Signifigant Field used to distinguish between the blank fields/Objects was the Parent Title and the Index. But now contrary to the User Guide the Index value changes and the field cannot be uniquely identified and hence cannot be attached to. The application developer showed me that each field in the application has a unique handle. Could this be used? Or is there a way to uniquely identify these fields on the Delphi application I must test?

    Sincerely,
    Ciarán.

    ------------------

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    489
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying fields in Delphi Application

    I've had the same problem with Delphi.
    To solve the problem I've had to use the X and/or Y possition of the contorl as a significant feild.

    There is one other way.
    You could use the format
    "~<n>~<progname>~<classname>~<windowtitle>"
    instead of using object maps. This way seems to index the controls differnetly than the way QARun does it. This one always works, but you aren't using object maps. You can create a file of constants that contain this formate and just include it in your scripts that use those objects. This would be creating your own object mapping instead of using QARun's.

    ------------------
    "If your not part of the solution, there's good money to be made in prolonging the problem."
    If your not part of the solution, there's good money to be made in prolonging the problem.

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Location
    Surrey, England
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying fields in Delphi Application

    Thank you for your response.

    Using the X and/or Y possition of the control as a significant field is not an option as these fields may change position on the screen. At least using the Index as it is described in the QA Run user Guide is more robust, indexing objects according to when it meets them in a top left to bottom right order. Actually, when you view the objects on the Delphi application screen using the Identify facitity, it indexes each object as specified above. So the first EditBox (top left to bottom right order) has an attached name of ~P~Module~Class~Parent~Index, where the Index is 1. The second EditBox will have an index value of 2. This is good, is useful and as expected. But when this is object is added as a new entry to the Object Map, Object map - New entry, it picks to an Index value from Delphi (I guess) which can vary and hence is no good for consistantly identifying the object. So not only does the ID value change when the Delphi application is opened but the Index value changes sometimes also. I'm running out of unique properties to identify these Delphi fields. But would you know of a way we can use the QA Run Index value as seen using the Identify facility instead of what is picked up from Delphi?

    Regarding your suggestion to create my own object map and include this in my QA Run script, I am not sure how to create this but I am looking into it, but surely I will be faced with the same problem. I can get certain properties for each object, Class Name, Type, Module, Parent, etc., from Delphi. But from what I can see these properties do not make an object unique except for the ID, Index and x/y coordinates.

    Sincerely,
    Ciarán.

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    489
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying fields in Delphi Application

    There is no way to get the Object Map to use the index you get when you use ~P~Module~Class~Parent~Index.

    To do your own object maps:
    Create a new script and remove everything from it. Create constants for all your objects:

    Const MainWindow = "~P~Module~Class~Parent~Index"
    Const UserNameEdit = "~P~Module~Class~Parent~Index"
    Const UserPassEdit = "~P~Module~Class~Parent~Index"

    Then in the script you wish to use the new maps put an include at the very top of the script before anything else, even main:

    Include "MyObjectConstants"

    Now use those constants instead of object maps.


    Attach MainWindow
    EditText UserNameEdit, "myid"
    EditText UserPassEdit, "mypass"

    ------------------
    "If your not part of the solution, there's good money to be made in prolonging the problem."
    If your not part of the solution, there's good money to be made in prolonging the problem.

  5. #5
    Senior Member
    Join Date
    Mar 2001
    Posts
    176
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Identifying fields in Delphi Application

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>This way seems to index the controls differnetly than the way QARun does it. <HR></BLOCKQUOTE>

    You are 100% correct. According to Compuware the index in an object map entry is not the same as a raw attach name index. Unfortunately, I don't recall the exact criteria on which each is based.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:46 PM.

Copyright BetaSoft Inc.