Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Andrei Ghimus on Oct 23, 2007 02:21
open dhtmlx forum
dhtmlXGrid and firewatir

FireWatir is a testing framework based on WET and written for Firefox. This is what we currently use to test our mail application written to include dhtmlXGrid for the folder view.
My problem: I can't find any way to identify a valid object which to 'click' in order to activate the row selection on the grid.
I identify HTML objects like this: obj=ff.element_by_xpath("//td[@title='sender_name']") . Now, normally, in order to trigger the onClick event on the object I just identified, I'd just obj.click or obj.fire_event "onclick". Unfortunately, this doesn't work, and the complexity of dhtmlXGrid is not allowing me to dig any further to find my clickable object.
All suggestions are appreciated.
Answer posted on Oct 23, 2007 10:18
The next XPath can be used for locate cell in question ( it is untested, by must work )

row

    obj=ff.element_by_xpath("//div[@className='objBox']").rows[index+1];
where index is zero based index of row

cell
    obj=ff.element_by_xpath("//div[@className='objBox']").rows[index+1].cells[cell_index];
where index is zero based index of row


To simplify location you can enable HTML ID for grid cells

    grid.enableCellIds(true);

after such command each cell in grid will have ID="c_"+row_idd+"_"+column_index;