can't retrieve listitems from combobox in flex website

Ask general questions here.
kami
Posts: 2
Joined: Mon Jan 12, 2015 7:02 am

can't retrieve listitems from combobox in flex website

Post by kami » Mon Jan 12, 2015 7:22 am

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.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

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

Post by Ciege » Mon Jan 12, 2015 4:14 pm

If you take a RanorexSpy Snapshot and post that, it would be much more beneficial for us to examine and respond accordingly.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...