Forum


18:46

06/11/2008

I set up a grid to display data. When I click on a row the grid populates HTML elements on the page. This works when I test manually.
I want to automate these test steps by driving the grid using Selenium.
I tried doing $('tr#1602').click() to simulate the user clicking on a row. However, jqGrid does not respond to this.
Which element should I direct the click to?
Is there a better way to automate testing a jqGrid instance?
Thanks,
Alvin.
18:00

06/11/2008

The 'onSelectRow' callback is:
var row_data = $('#list').getRowData(row_id);
$('input#asset_id').val(row_id);
$('input#asset_title').val(row_data.title);
}
It populates the #asset_id and #asset_title inputs with data from the grid. This works well.
I want to create an automated test that simulates the user clicking on the row to fire the 'onSelectRow' callback. The goal is to verify the page is updated as expected.
Normally when I want to simulate the user following a link I can do something like:
find_link_with_name('Follow me').click
I do not understand the jqGrid mouse event processing well enough to identify which HTML tag to "click" that will trigger the 'onSelectRow' callback.
One option is to run javascript that sets the selected row:
@browser.execute_script("$('#list').setSelection('34')")
I am hoping to achieve the same result without using javascript.
I will post a better example in a week or so.
Alvin.
Most Users Ever Online: 715
Currently Online:
38 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66