Results 1 to 4 of 4
  1. #1

    NameMapping and Aliases

    Using the 30 day trial, I have been trying the get NameMapping + Aliases working from a script (not using the TC5’s dialogs and panes windows). What I am trying to do is write 1 NameMapping script that I can modify if the tested GUI app changes, and also create Aliases for all mapped controls.

    One post on this board suggests reading control ID information from an excel sheet and creating the map at runtime. Then somehow creating an Aliases for the controls and using the below syntax to access the control.

    var A = Eval("Aliases." & tmpID);

    I like this idea, but I am unable to this to work programmatically. I have tried following the help file, but the examples don’t seem to work for me.

    Does anymore have a better approach for what I am trying to do? And also a code sample. Thanks.

  2. #2
    SQA Knight
    Join Date
    May 2006
    Playa Del Rey, California, United States

    Re: NameMapping and Aliases

    Creating an Map on runtime is very difficult. There arn't any methods I know of that let you programatically alter the NameMapping on runtime, so you'll end up having a lot of code to edit the NameMapping XML file.

    I think a better approach is to use lots of wild card characters in place of things that can be variable. For example, say you have "Product X - Save File", and it might change to "Product Y - Save File", I would recommend mapping it to recognize "* - Save File".

    The control ID would work too if you're certain they'll stay constant. I think you're better off recognizing captions and other properties the end user will notice. When developers rearchitect the program, you'll get lots of objects that'll need to be remapped.
    David Lai
    SDET / Consultant
    LinkedIn profile

  3. #3

    Re: NameMapping and Aliases


    I suggest that you use the Find method to locate objects by values of their properties instead of modifying Name Mapping at run-time. Please see the "Find Method" help topic for details.
    Jared - AQA Support

  4. #4

    Re: NameMapping and Aliases

    So what I gathered is that I should be able to save a script with objects that match properties. Then I can use the Find Method to see if the control exists first, and then execute an operation on it such as clicking.

    For example, a “Connect” command button might have the caption “connect device”. If I want to click this button, I would first use the Find Method to locate it, and the send the click operation to it.

    What I am trying to do is keep things central, so that test cases do not break. And it looks like a text readable script file with objects to properties is one way of doing that. I will have to experiment some more.

    Thanks for the suggestions guys.



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 05:58 PM.

Copyright BetaSoft Inc.