xpath of the combobox: ?/?/table/tbody/tr[2]/?/?/table//flexobject[@id='xxxxx']//container[@id='searchScreen']/container[@id='searchPanel']/container[@id='innerSearchPanel']/container[@id='bodyVBox']/container[@id='documentFilter']/container[@id='filterVBox']/container[@id='filterHBox']//combobox[@id='docTypeCombo']
xpath of one listitem in this combobox: ?/?/table/tbody/tr[2]/?/?/table//flexobject[@id='xxxxx']/list[1]/listitem[@text='DATAFILE']/text[@caption='DATAFILE']
Code: Select all
var repo = Repository.Instance;
var docTypeCombo= repo.XX.XX.DocTypeCombo;
int i = docTypeCombo.Items.Count;
Report.Info(i.ToString()); // 0; no listitems in this comobobox, but actually there are 3 listitems
Code: Select all
var repo = Repository.Instance;
var docTypeCombo = repo.xx.xx.DocTypeCombo;
docTypeCombo.Click();
docTypeCombo.Items[1].Click(); //there are three items; but i got an error: Error: Index was out of range. Must be non-negative and less than the size of the collection.
Code: Select all
var repo = Repository.Instance;
var docTypeCombo = repo.xx.xx.DocTypeCombo;
ListItem item = docTypeCombo .FindSingle<ListItem>("//listitem[@text='DATAFILE']");
//can't find this listitem
I can't figure out the reason. Can anyone help me with this? Much appreciated.