Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Drive jqGrid with Selenium or Celerity
23/01/2009
18:46
Avatar
alvin
Member
Members
Forum Posts: 4
Member Since:
06/11/2008
sp_UserOfflineSmall Offline

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.

23/01/2009
20:07
Avatar
rsea
Member
Members
Forum Posts: 17
Member Since:
24/01/2009
sp_UserOfflineSmall Offline

Have you tried 'onSelectRow' option?

To automate, I'm not sure if I get what you want but I think it is populate html atfer loading the grid, the option 'loadComplete' runs functions after the loading is complete, you could use it for what you want.

Best regards,

Rodolfo.

26/01/2009
18:00
Avatar
alvin
Member
Members
Forum Posts: 4
Member Since:
06/11/2008
sp_UserOfflineSmall Offline

The 'onSelectRow' callback is:

function(row_id) {
  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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information