Page 1 of 1

can't retrieve listitems from combobox in flex website

Posted: Mon Jan 12, 2015 7:22 am
by kami
I have a combobox in a flex web.

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.

Re: can't retrieve listitems from combobox in flex website

Posted: Mon Jan 12, 2015 4:14 pm
by Ciege
If you take a RanorexSpy Snapshot and post that, it would be much more beneficial for us to examine and respond accordingly.