Forum Discussion

Stan's avatar
Stan
Occasional Contributor
13 years ago

Playback lacks Consistency

Hi!


I am working in automating Flex Controls using Flash Injector. I have a bit wierd scenario. I would like to gather input, if there are some successful trials earlier...


There is a MenuControl that appears on clicking a menu holding sub menus. When child menu is clicked, another MenuControl appears. Let us name it MenuControl1 and MenuControl2 respectively. If the object is identified MenuControl1 will have index as '0' and when MenuControl2 is seen MenuControl1 will have index as '1', leaving MenuControl2 with '0' index. In simplified way, the new control will have the '0' index and old ones are updated in the object browser. May be if I can call this as Cycling Index :) or if Adobe developers have a different name to it...


On recording, there seems to be some intelligence, MenuControl(1) which will no way be there when recording as it will be the new Menucontrol and only one at that time is however updated while auto scripting...


<br />

<div class="sf_ForumsCode"> 

  ' there is a menu clicked...

  vobject.MenuControl(1).MenuItemRenderer(3).ClickButton 'selecting 4th child menu

  vobject.MenuControl(0).MenuItemRenderer(0).ClickButton 'selecting 1st grandchild menu

</div>



Practically on playback this fails. Trying any alternatives also fails. I tried referring vobject.MenuControl(0) both times which could be a resonable try, also with vobject.Refresh. The result is not consistent; it works sometimes and doesn't repeat :(


Is there a problem in Test Complete to catch the refreshed objects (index cycled) in a quick time during playback? Please let me know if there is any alternative way to handle menus in flex. However this Cycling Index problem is also in other controls too...


Regards,

Stan

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Stanley,


    It seems to me that the topmost menu should have the least index. So, calling Refresh seems to be a reasonable solution. Did you call Refresh after each click on a menu item? This should give the test engine time to rebuild the tree and re-assign indexes.


    Another possible workaround is to address the needed items by their caption (text) rather than by indexes. You can try this and see if it works for you.


    Anyhow, I'd say, the situation needs investigation. I'd suggest that you contact our Support Team and send them a problem description along with your Flex app demonstrating the problem. We will examine it and try to find a solution.

  • Stan's avatar
    Stan
    Occasional Contributor
    Hi Alex!



    Thanks for asserting on the use of Refresh, I also added a delay of 1 second and having implemented after each menu clicks have realized that there is no consistency in the index, the new menu control is 0 or 1.... Did a trick to grab the dynamic behavior to resolve...



    Thanks for your time and suggestion.



    Regards,

    Stanley
  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Hi Stanley,


    So, did Refresh help? Did you find a solution?

  • Stan's avatar
    Stan
    Occasional Contributor
    Alex!



    Refresh might not have directly helped in solution, but confirmed that the there is a varying index in the app that causes the playback consistency, therefore no issues in TC :)



    Solution is a trick, I rely on the menu count in the new and old menu to flip 0 & 1.... This might not work if the both the menu have same counts, lucky escape :)



    Thanks!

    Stanley