fernando_miguel
10 years agoOccasional Contributor
Firefox crashes while recording click on PopUpMenuButton
When we record a click on a mx:PopUpMenuButton Firefox always crashes.
Problem occurs at least in following versions of TC/Firefox we have tried:
* FF 27.0.1, 30.0.0
* Adobe Flash Debug 11-14
* TC 10.10, 10.30
Our PopUpMenuButton is defined like this:
<mx:PopUpMenuButton id="popUpButton"
label="{resourceManager.getString('events_rb', 'options')}"
dataProvider="{menuProvider}"
labelField="label"
includeInLayout="{model.operation == CRUDUtils.CONSULT}"
visible="{model.operation == CRUDUtils.CONSULT}"
styleName="colorizedPopUpButton"
click="this.popUpButton.open();"/>
We use an ArrayCollection as data provider for this object:
<s:ArrayCollection id="menuProvider">
<!--<fx:Object operId="{EventsModel.ACTION_REFRESH}" label="{resourceManager.getString('events_rb', 'refreshEvent')}"/> -->
<fx:Object operId="{CRUDUtils.MODIFY}" label="{resourceManager.getString('events_rb', 'editEvent')}" />
<fx:Object operId="{CRUDUtils.DUPLICATE}" label="{resourceManager.getString('events_rb', 'copyEvent')}"/>
</s:ArrayCollection>
This array collection is modified according to the view so we add/remove more "Object" options to "menuProvider" (that occurs during initialization of the view).
We have also tried skipping recording and using the script provided here without luck: http://smartbear.com/forums/f78/fp5/t65047/how-to-select-specfic-popupmenubutton-using-te/ (we converted it to JScript):
function ClickPopUpMenuItem(PopUpMenuButton, ItemText) {
PopUpMenuButton.Click(PopUpMenuButton.Width-5, PopUpMenuButton.Height/2);
var AppObject, ItemObject, PropNames, PropValues;
// Obtain the Flex application object
AppObject = PopUpMenuButton.Parent;
while (AppObject.ObjectType == "Object")
{
AppObject = AppObject.Parent
}
// Find a pop-up menu item by text
PropNames = new Array("ObjectType", "FlexObject.listData.label");
PropValues = new Array("MenuItemRenderer", ItemText);
ItemObject = AppObject.FindChild(PropNames, PropValues, 5);
if(ItemObject.Exists) {
ItemObject.Click();
} else {
Log.Error("PopUpMenuButton item '" + ItemText + "' was not found.");
}
}
The problem seems to be TC not recognizing the items of the button since the script always fails at line (no matter which text option we provide):
Log.Error("PopUpMenuButton item '" + ItemText + "' was not found.");
What can we do?
Problem occurs at least in following versions of TC/Firefox we have tried:
* FF 27.0.1, 30.0.0
* Adobe Flash Debug 11-14
* TC 10.10, 10.30
Our PopUpMenuButton is defined like this:
<mx:PopUpMenuButton id="popUpButton"
label="{resourceManager.getString('events_rb', 'options')}"
dataProvider="{menuProvider}"
labelField="label"
includeInLayout="{model.operation == CRUDUtils.CONSULT}"
visible="{model.operation == CRUDUtils.CONSULT}"
styleName="colorizedPopUpButton"
click="this.popUpButton.open();"/>
We use an ArrayCollection as data provider for this object:
<s:ArrayCollection id="menuProvider">
<!--<fx:Object operId="{EventsModel.ACTION_REFRESH}" label="{resourceManager.getString('events_rb', 'refreshEvent')}"/> -->
<fx:Object operId="{CRUDUtils.MODIFY}" label="{resourceManager.getString('events_rb', 'editEvent')}" />
<fx:Object operId="{CRUDUtils.DUPLICATE}" label="{resourceManager.getString('events_rb', 'copyEvent')}"/>
</s:ArrayCollection>
This array collection is modified according to the view so we add/remove more "Object" options to "menuProvider" (that occurs during initialization of the view).
We have also tried skipping recording and using the script provided here without luck: http://smartbear.com/forums/f78/fp5/t65047/how-to-select-specfic-popupmenubutton-using-te/ (we converted it to JScript):
function ClickPopUpMenuItem(PopUpMenuButton, ItemText) {
PopUpMenuButton.Click(PopUpMenuButton.Width-5, PopUpMenuButton.Height/2);
var AppObject, ItemObject, PropNames, PropValues;
// Obtain the Flex application object
AppObject = PopUpMenuButton.Parent;
while (AppObject.ObjectType == "Object")
{
AppObject = AppObject.Parent
}
// Find a pop-up menu item by text
PropNames = new Array("ObjectType", "FlexObject.listData.label");
PropValues = new Array("MenuItemRenderer", ItemText);
ItemObject = AppObject.FindChild(PropNames, PropValues, 5);
if(ItemObject.Exists) {
ItemObject.Click();
} else {
Log.Error("PopUpMenuButton item '" + ItemText + "' was not found.");
}
}
The problem seems to be TC not recognizing the items of the button since the script always fails at line (no matter which text option we provide):
Log.Error("PopUpMenuButton item '" + ItemText + "' was not found.");
What can we do?