Forum Discussion
Hi,
I've add step to perform action, but it still doesn't work
- Below is the code:
function cboSelectWPF(inventoryType, value)
{
switch (inventoryType) {
case DEFAULT_BEAM: combobox = ddDefaultBeam ; break;
case DEFAULT_SHEET: combobox = ddDefaultSheet ; break;
case BOTTOM_PLATE: combobox = ddBottomPlate ; break;
case SPACING_BEAMS: combobox = ddSpacingBeams ; break;
case TOP_PLATE: combobox = ddTopPlate ; break;
}
combobox.ClickItem(value);
}
combobox is dropdown list with object in the screenshot
- Here is the properties of dropdown object. Could you pls check?
--------------------
Also I tried another way by expanding the dropdown menu then selecting a value but it didn't work.
I see the drop down menu expanded but can't select a value.
here is the script that I used to expanded the dropdown, then select the value with Click() function
function cboSelectWPF(inventoryType)
{
switch (inventoryType) {
case DEFAULT_BEAM: combobox = ddDefaultBeam ; break;
case DEFAULT_SHEET: combobox = ddDefaultSheet ; break;
case BOTTOM_PLATE: combobox = ddBottomPlate ; break;
case SPACING_BEAMS: combobox = ddSpacingBeams ; break;
case TOP_PLATE: combobox = ddTopPlate ; break;
}
combobox.Click();
aqUtils.Delay(1000);
tb2x4.Click();
}
combobox.Click(): to expand the dropdown list
tb2x4.Click(): select with the value 2x4 from dropdown list
First - get the name mapping of this control,
Use either full name or alias name mapping for this control.Second - then perform object.ClickItem("2 X 4") to select the desired item shown in the list,
ClickItem("2 X 4")Where object is the name mapping of the control, and assuming "2 X 4" is the item to be selected. Note the list of items shown, might be a custom control, as combo control usually just has list of items. But in this instance, it's showing labels as well i.e. "Lumber Inventory" and "Sheet Inventory".
I suggest you try the example code, that I had originally provided (not using cboSelectWPF), to check the functionality of ClickItem() actually works for you. Also, since this is a WPF object, there may be a method that you can use, shown in the Methods tab.
FYI. Your alias name is way to long - refer to Name Mapping