Advertisement

09.09.2008 at 12:13PM PDT, ID: 23716811 | Points: 250
[x]
Attachment Details

Browser automation with WatiN for Ajax (Ext JS) data grid

Asked by Leprechaun in Asynchronous Javascript and XML (AJAX), XPath

Tags: ,

Hi,

I need to make UATs in NUnit/WatiN for a website that uses Ext JS and, therefore, has a lot of Ajax.

I've done this on non-Ajax sites before, but I'm wondering if there are any gotcha's here.

I've seen complaints on forums about the onClick() event handler for div tags in grids being hidden from WatiN (or Selenium), which made it impossible to click on them normally (that is through XPath).

Two questions:
1) Is this the case with Ext JS-produced HTML?
2) If so, how do you automate a click?

Thanks.

Leprechaun

P.S. I'm attaching HTML below is for the 1st two rows of a data grid generated using Ext JS. The 1st top-level DIV is for the header and the 2nd top-level DIV is for the first result in the grid.
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
<div class="x-grid3-viewport" id="ext-gen46">
  <div class="x-grid3-header" id="ext-gen47">
    <div class="x-grid3-header-inner" id="ext-gen54">
      <div class="x-grid3-header-offset">
        <table cellspacing="0" cellpadding="0" border="0" style="width: 723px;">
          <thead>
            <tr class="x-grid3-hd-row">
              <td style="width: 238px;" class="x-grid3-hd x-grid3-cell x-grid3-td-0">
                <div style="" unselectable="on" class="x-grid3-hd-inner x-grid3-hd-0">
                  Prospect Name<img src="/scripts/ext/resources/images/default/s.gif" class="x-grid3-sort-icon">
                </div>
              </td>
              <td style="width: 238px;" class="x-grid3-hd x-grid3-cell x-grid3-td-1">
                <div style="" unselectable="on" class="x-grid3-hd-inner x-grid3-hd-1">
                  Client<img src="/scripts/ext/resources/images/default/s.gif" class="x-grid3-sort-icon">
                </div>
              </td>
              <td style="width: 241px;" class="x-grid3-hd x-grid3-cell x-grid3-td-2">
                <div style="" unselectable="on" class="x-grid3-hd-inner x-grid3-hd-2">
                  Description<img src="/scripts/ext/resources/images/default/s.gif" class="x-grid3-sort-icon">
                </div>
              </td>
            </tr>
          </thead>
        </table>
      </div>
    </div>
    <div class="x-clear">
    </div>
  </div>
  <div class="x-grid3-scroller" id="ext-gen48" style="overflow: visible;">
    <div class="x-grid3-body" id="ext-gen49">
      <div style="width: 723px;" class="x-grid3-row">
        <table cellspacing="0" cellpadding="0" border="0" style="width: 723px;" class="x-grid3-row-table">
          <tbody>
            <tr>
              <td tabindex="0" style="width: 238px;" class="x-grid3-col x-grid3-cell x-grid3-td-0 x-grid3-cell-first">
                <div unselectable="on" class="x-grid3-cell-inner x-grid3-col-0">
                  Test Prospect
                </div>
              </td>
              <td tabindex="0" style="width: 238px;" class="x-grid3-col x-grid3-cell x-grid3-td-1">
                <div unselectable="on" class="x-grid3-cell-inner x-grid3-col-1">
                  Test Company 2
                </div>
              </td>
              <td tabindex="0" style="width: 241px;" class="x-grid3-col x-grid3-cell x-grid3-td-2 x-grid3-cell-last">
                <div unselectable="on" class="x-grid3-cell-inner x-grid3-col-2">
                  Test Description edit
                </div>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <a tabindex="-1" class="x-grid3-focus" href="#" id="ext-gen50">
    </a>
  </div>
</div>
[+][-]09.09.2008 at 12:16PM PDT, ID: 22431093

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628