Forum Discussion
Dmitry_Nikolaev
15 years agoStaff
Hi James,
We were able to reproduce this behavior, and we will investigate it. In the meantime, you can use the below script to accomplish your task:
function ClickItemMain()
{
var wComboBox = Sys.Process("WINWORD").Form("Document1 -").Window("FullpageUIHost").Window("NetUIHWND").Pane("Backstage view").Client(0).Pane("Print").Grouping("Print").Grouping(0).Client(0).ComboBox("Which Printer");
var strItem = "Microsoft XPS Document Writer";
if (ClickItem(wComboBox, strItem))
{
Log.Message("The '" + strItem + "' combo-box item was successfully clicked.");
}
}
function ClickItem(wCombo, strItem)
{
Log.LockEvents(1);
//Open dropdown
wCombo.Button("Open").Click();
var p = getProcess(wCombo);
//Get dropdown
var wDropdown = p.Window("Net UI Tool Window", "", 1).Panel("Which Printer").List("Which Printer").Client(0);
var wlistItem = wDropdown.FindChild("Caption", strItem)
if (wlistItem.Exists)
{
//Click item
wlistItem.Click();
Log.UnLockEvents();
Log.Event("The '" + strItem + "' combo-box item was clicked.");
return true;
}
else
{
Log.UnLockEvents();
Log.Error("The '" + strItem + "' combo-box item was not found.");
return false;
}
}
function getProcess(obj)
{
while (!IsSupported(obj, "ProcessName"))
{
obj = obj.Parent;
}
return obj;
}
Related Content
- 11 years ago
Recent Discussions
- 3 hours ago
- 10 hours ago
Working with Visual Test
Solved2 days ago