recording jcombobox value change, which is in jtable cell

122 views
Skip to first unread message

NItin

unread,
Jul 20, 2009, 7:11:48 AM7/20/09
to Marathon Java GUI Testing
Hii all

I am trying to record script for changing the JCombobox selected value
which is inside the JTable's Cell


I am gettting script somthing like this.

select('tableName', 'cell:Sell,0(true)')

but when I playback the script its not working

Do anybody has faced the scenario i.e.changing the JCombobox value
which is inside the cell for JTable while recording marathon script.

I tried all P & C

cellEditor=jTable.getCellEditor(i,8)
component=cellEditor.getComponent()
component.setSelectedIndex(-1)
component.setSelectedItem("Accepted")

But it doesnt get reflected. I tried 1.2.1.1 and 2.0b4 version

Could some one tell me how to go about it?

Thanks
Nitin




dimitri3

unread,
Jul 20, 2009, 9:08:00 AM7/20/09
to Marathon Java GUI Testing
Hi Nitin,

try something like this:

myComboBox = jTable.getValueAt(rowIndex,colindex)
myComboBox.setValue("Accepted"))

Dimitri

vasu sasi

unread,
Jul 20, 2009, 9:15:47 AM7/20/09
to marathon...@googlegroups.com
Hi Nitin,
         Try this,select the row in the table and use the below syntax
 select('Tablename', 'value u need to set in combobox', 'Comboboxheadername inside ur table,rowvalue u need to change')

Thanks,
Kala.


NItin

unread,
Jul 21, 2009, 1:39:47 AM7/21/09
to Marathon Java GUI Testing
Hiii all

Thanks 4 help.

I tried both approach, still its not working.


cellEditor=jTable.getCellEditor(i,8)
myComboBox=cellEditor.getComponent()
myComboBox.setSelectedIndex(-1)
myComboBox.setSelectedIndex(2)
print myComboBox.getSelectedItem()

this is printing the item which is at index 2 of jcombobox.

but it is not getting reflected in UI. Do anybody knw hw to reflect
the jcombobox UI when its selecteditem is changed?



For
myComboBox = jTable.getValueAt(rowIndex,colindex)

its returning NoneType' object

and for

select('Tablename', 'value u need to set in combobox',
'Comboboxheadername
inside ur table,rowvalue u need to change')

its not working too.

anyways thanks for help

vasu sasi

unread,
Jul 21, 2009, 7:28:08 AM7/21/09
to marathon...@googlegroups.com
Hi,
 this is my script it works for me,
click('Add12')
    if window('Add Quality of Service Rule'):
        select('Table', '23', 'PRate,0')
        select('Table', '34', 'CRate,0')
        select('Table', '45', 'BRate,0')
        select('Table', '4', 'comb,0')//this line is to add r change values in combobox.
        click('OK')
    close()

i am running marathon-1.1.3

Thanks,
Kala

NItin

unread,
Jul 21, 2009, 8:32:31 AM7/21/09
to Marathon Java GUI Testing
HIi Kala

it works for me too but in 2.0b3 version.previously i was trying on
1.2.1.1 and 2.0b4 version .

Thanks a lot for help

Nitin
Reply all
Reply to author
Forward
0 new messages