How add item to a combobox

Jun 7, 2011 at 7:06 AM

Hello,

I new in White and i'm trying to automate passing a string (the path and filename) to a  combobox in a windows download dialog box and clicking the save button.

I'm able to click the button and to scroll the combobox that hold the path and filename of the recents downloaded files but the combobox doesn´t allow me to change the text of the selected item, it says that the value is read only.

I tried to add a new item with the followind code:

ComboBox comboboxFilename = window.Get<ComboBox>("Name:");
AutomationElement ae = window.AutomationElement;
Win32ListItem itemCombo = new Win32ListItem(ae, new NullActionListener());
comboboxFilename.Items.Add(itemCombo);

But the item is not added the line bellow raise and error because it doesn´t find the text entered (the new item)

comboboxFilename.Select(itemCombo.Text);  <== Error

How can i enter new text in a combobox?

Any help will be appreciated, thank in advance,

Esteban

 

 

Jun 7, 2011 at 8:08 AM

Hi

ComboBox does not have a field to write text in it.

 

In that casese the comboBox has a child element with ControlTyp.Edit and White UIItem Type TextBox.

 

Have a look on the UI Elements using UIVerify or UISpy

 

Throndorin