Forum Discussion

emailvision_Sup's avatar
emailvision_Sup
Occasional Contributor
15 years ago

different behavior between aliase and the same direct path

Hello,



I have a strange behavior that I can't clarify. I'm testing a flex application embedded into a web page.

In my script, in some specific cases when I call directly the item (ie: Sys.Process("iexplore").Page("https://XXXX").Frame("bottom").Object("myFlashContent").Button(0).Click();) it's clicking in the middle of the frame but if I use the mapped object (to the same link) then it's clicking at the right place.



I don't wan't to mix aliases and direct calls in the same script so I would like to understand how I can have different behavior from the single link and the mapped alias to this link.



Does any of you already faced this kind of things? 



Thanks,

Nicolas.

  • Hi Nicolas,





    First of all, I recommend that you always use Aliases for objects identification. In this case, you won't have to modify all your scripts if some properties or even the object hierarchy changes in your application.





    As for the click problem, it can be caused by the fact that the full name and the mapped name actually refer to different objects. I recommend that you set a breakpoint on the problematic line and compare properties of the two objects thoroughly. Also, try highlighting both objects on screen and make sure the browser zoom  is set to 100% in your system.


  • emailvision_Sup's avatar
    emailvision_Sup
    Occasional Contributor
    Hello Allen,



    thanks for your answer. Using the breakpoint I see the same object. I'm mostly using the direct call for object because some of them are not working by mapping in the flex embedded.



    for example I've tried mapping to click on a listItem of a dynamic dropdown list in the flex and I can use the Sys ref without problem but the mapped object is not clickable even with the same sys reference. 



    direct ref: 

    Sys.Process("iexplore", 2).Page("https://XXXX").Frame("bottom").Object("myFlashContent").List(1).ListItem("New_Email")

    Alias:

    Aliases.iexplore.pageCampaignCommander.frameBottom.objectMyflashcontent.List(1).Click();



    And via alias or namemapping I can't even see the list, when clicking on it  I get message '...underkying object missing...' because the drop down list is a non permanent item.



    It looks like namemapping and aliasing is not stable for dynamic content inside flex. Please note that I'm currently testing my application just with "accessible true" in options but without the flexclient.swc or automation.swc (I'm waiting for some internal support to clear that point). I don't know if this can explain the behavior I'm currently facing.



    Thanks,

    Nicolas.
  • emailvision_Sup's avatar
    emailvision_Sup
    Occasional Contributor
    Hello Allen,



    thanks for your answer. Using the breakpoint I see the same object. I'm mostly using the direct call for object because some of them are not working by mapping in the flex embedded.



    for example I've tried mapping to click on a listItem of a dynamic dropdown list in the flex and I can use the Sys ref without problem but the mapped object is not clickable even with the same sys reference. 



    direct ref: 

    Sys.Process("iexplore", 2).Page("https://XXXX").Frame("bottom").Object("myFlashContent").List(1).ListItem("New_Email")

    Alias:

    Aliases.iexplore.pageCampaignCommander.frameBottom.objectMyflashcontent.List(1).ListItem("New_Email").Click();



    And via alias or namemapping I can't even see the list, when clicking on it  I get message '...underkying object missing...' because the drop down list is a non permanent item.



    It looks like namemapping and aliasing is not stable for dynamic content inside flex. Please note that I'm currently testing my application just with "accessible true" in options but without the flexclient.swc or automation.swc (I'm waiting for some internal support to clear that point). I don't know if this can explain the behavior I'm currently facing.



    Thanks,

    Nicolas.

  • Hi Nicolas,





    Note that Flex support has been improved in TestComplete 8.10 which has been released today. I recommend that you update to this version, re-record the problematic part of your test and check whether the problem persists.





    BTW, if an object can be found via its full name, but cannot be found via Name Mapping, it just means that the Name Mapping scheme is not reliable enough. If you make your Name Mapping scheme use the same recognition criteria which are used in full names, you should get the same recognition result. If some objects are created dynamically, it might also be necessary to call the Refresh method (for full names) or the RefreshMappingInfo (for aliased/mapped names) to make TestComplete "see" the changes.