watir-classic 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +721 -0
- data/LICENSE +34 -0
- data/README.rdoc +78 -0
- data/VERSION +1 -0
- data/bin/watir-console +5 -0
- data/lib/watir-classic.rb +14 -0
- data/lib/watir-classic/IEDialog/Release/IEDialog.dll +0 -0
- data/lib/watir-classic/assertions.rb +44 -0
- data/lib/watir-classic/browser.rb +149 -0
- data/lib/watir-classic/browsers.rb +7 -0
- data/lib/watir-classic/close_all.rb +31 -0
- data/lib/watir-classic/container.rb +110 -0
- data/lib/watir-classic/contrib/enabled_popup.rb +21 -0
- data/lib/watir-classic/contrib/ie-new-process.rb +27 -0
- data/lib/watir-classic/contrib/page_checker.rb +29 -0
- data/lib/watir-classic/cookies.rb +80 -0
- data/lib/watir-classic/core.rb +43 -0
- data/lib/watir-classic/dialogs/file_field.rb +34 -0
- data/lib/watir-classic/dialogs/javascript.rb +43 -0
- data/lib/watir-classic/drag_and_drop_helper.rb +68 -0
- data/lib/watir-classic/element.rb +438 -0
- data/lib/watir-classic/element_collection.rb +109 -0
- data/lib/watir-classic/element_extensions.rb +69 -0
- data/lib/watir-classic/exceptions.rb +50 -0
- data/lib/watir-classic/form.rb +96 -0
- data/lib/watir-classic/frame.rb +47 -0
- data/lib/watir-classic/ie-class.rb +767 -0
- data/lib/watir-classic/ie-process.rb +47 -0
- data/lib/watir-classic/ie.rb +20 -0
- data/lib/watir-classic/image.rb +111 -0
- data/lib/watir-classic/input_elements.rb +480 -0
- data/lib/watir-classic/irb-history.rb +31 -0
- data/lib/watir-classic/link.rb +46 -0
- data/lib/watir-classic/locator.rb +243 -0
- data/lib/watir-classic/logger.rb +19 -0
- data/lib/watir-classic/matches.rb +23 -0
- data/lib/watir-classic/modal_dialog.rb +72 -0
- data/lib/watir-classic/module.rb +12 -0
- data/lib/watir-classic/non_control_elements.rb +114 -0
- data/lib/watir-classic/options.rb +56 -0
- data/lib/watir-classic/page-container.rb +114 -0
- data/lib/watir-classic/process.rb +20 -0
- data/lib/watir-classic/screen_capture.rb +115 -0
- data/lib/watir-classic/supported_elements.rb +172 -0
- data/lib/watir-classic/table.rb +224 -0
- data/lib/watir-classic/testcase.rb +97 -0
- data/lib/watir-classic/util.rb +35 -0
- data/lib/watir-classic/version.rb +4 -0
- data/lib/watir-classic/wait.rb +41 -0
- data/lib/watir-classic/wait_helper.rb +12 -0
- data/lib/watir-classic/waiter.rb +98 -0
- data/lib/watir-classic/win32.rb +40 -0
- data/lib/watir-classic/win32ole.rb +16 -0
- data/lib/watir-classic/win32ole/1.8.7/win32ole.so +0 -0
- data/lib/watir-classic/win32ole/1.9.3/win32ole.so +0 -0
- data/lib/watir-classic/window.rb +68 -0
- data/lib/watir-classic/xpath_locator.rb +52 -0
- data/rakefile.rb +54 -0
- data/unittests/all_tests.rb +10 -0
- data/unittests/buttons_xpath_test.rb +68 -0
- data/unittests/checkbox_test.rb +163 -0
- data/unittests/checkbox_xpath_test.rb +106 -0
- data/unittests/click_no_wait_test.rb +23 -0
- data/unittests/close_all_test.rb +17 -0
- data/unittests/core_tests.rb +17 -0
- data/unittests/css_selector_test.rb +44 -0
- data/unittests/css_test.rb +38 -0
- data/unittests/dialog_test.rb +64 -0
- data/unittests/div2_xpath_test.rb +21 -0
- data/unittests/div_test.rb +170 -0
- data/unittests/div_xpath_test.rb +95 -0
- data/unittests/document_standards.rb +63 -0
- data/unittests/element_collection_indexes_test.rb +57 -0
- data/unittests/element_collections_test.rb +100 -0
- data/unittests/element_test.rb +47 -0
- data/unittests/errorchecker_test.rb +31 -0
- data/unittests/filefield_test.rb +43 -0
- data/unittests/filefield_xpath_test.rb +35 -0
- data/unittests/form_test.rb +282 -0
- data/unittests/form_xpath_test.rb +254 -0
- data/unittests/frame_test.rb +165 -0
- data/unittests/google_form_test.rb +15 -0
- data/unittests/html/JavascriptClick.html +39 -0
- data/unittests/html/blankpage.html +11 -0
- data/unittests/html/buttons1.html +40 -0
- data/unittests/html/checkboxes1.html +89 -0
- data/unittests/html/click_no_wait.html +14 -0
- data/unittests/html/complex_table.html +35 -0
- data/unittests/html/cssTest.html +42 -0
- data/unittests/html/depot_store.html +59 -0
- data/unittests/html/div.html +92 -0
- data/unittests/html/div_xml.html +21 -0
- data/unittests/html/fileupload.html +44 -0
- data/unittests/html/formTest1.html +38 -0
- data/unittests/html/forms2.html +44 -0
- data/unittests/html/forms3.html +131 -0
- data/unittests/html/forms4.html +26 -0
- data/unittests/html/frame_buttons.html +4 -0
- data/unittests/html/frame_links.html +4 -0
- data/unittests/html/frame_multi.html +5 -0
- data/unittests/html/google_india.html +119 -0
- data/unittests/html/ie7_document_standards.html +9 -0
- data/unittests/html/ie8_document_standards.html +9 -0
- data/unittests/html/ie9_document_standards.html +9 -0
- data/unittests/html/iframe.html +3 -0
- data/unittests/html/iframeTest.html +17 -0
- data/unittests/html/iframeTest1.html +7 -0
- data/unittests/html/iframeTest2.html +5 -0
- data/unittests/html/images/1.gif +0 -0
- data/unittests/html/images/2.GIF +0 -0
- data/unittests/html/images/3.GIF +0 -0
- data/unittests/html/images/button.jpg +0 -0
- data/unittests/html/images/circle.jpg +0 -0
- data/unittests/html/images/map.GIF +0 -0
- data/unittests/html/images/map2.gif +0 -0
- data/unittests/html/images/minus.GIF +0 -0
- data/unittests/html/images/originaltriangle.jpg +0 -0
- data/unittests/html/images/plus.gif +0 -0
- data/unittests/html/images/square.jpg +0 -0
- data/unittests/html/images/triangle.jpg +0 -0
- data/unittests/html/images1.html +65 -0
- data/unittests/html/javascriptevents.html +33 -0
- data/unittests/html/link_pass.html +11 -0
- data/unittests/html/links1.html +37 -0
- data/unittests/html/links2.html +11 -0
- data/unittests/html/links_multi.html +12 -0
- data/unittests/html/list_matters.html +720 -0
- data/unittests/html/lists.html +18 -0
- data/unittests/html/map_test.html +30 -0
- data/unittests/html/modal_dialog.html +10 -0
- data/unittests/html/modal_dialog_launcher.html +12 -0
- data/unittests/html/multiple_specifiers.html +64 -0
- data/unittests/html/nestedFrames.html +6 -0
- data/unittests/html/new_browser.html +17 -0
- data/unittests/html/pass.html +13 -0
- data/unittests/html/popups1.html +59 -0
- data/unittests/html/pre.html +29 -0
- data/unittests/html/quirks_document_standards.html +8 -0
- data/unittests/html/radioButtons1.html +71 -0
- data/unittests/html/select_tealeaf.html +54 -0
- data/unittests/html/selectboxes1.html +52 -0
- data/unittests/html/simple_table.html +25 -0
- data/unittests/html/simple_table_buttons.html +104 -0
- data/unittests/html/simple_table_columns.html +75 -0
- data/unittests/html/table1.html +179 -0
- data/unittests/html/tableCell_using_xpath.html +19 -0
- data/unittests/html/table_and_tablerow_to_a.html +174 -0
- data/unittests/html/textarea.html +30 -0
- data/unittests/html/textfields1.html +100 -0
- data/unittests/html/textsearch.html +44 -0
- data/unittests/html/wallofcheckboxes.html +1003 -0
- data/unittests/html/xpath_nbsp.html +11 -0
- data/unittests/html/zeroindex.html +11 -0
- data/unittests/ie_exists_test.rb +16 -0
- data/unittests/ie_mock.rb +94 -0
- data/unittests/ie_test.rb +54 -0
- data/unittests/images_test.rb +156 -0
- data/unittests/images_xpath_test.rb +90 -0
- data/unittests/index_specifier_test.rb +31 -0
- data/unittests/js_events_test.rb +31 -0
- data/unittests/links_multi_test.rb +34 -0
- data/unittests/links_test.rb +131 -0
- data/unittests/links_xpath_test.rb +38 -0
- data/unittests/lists_test.rb +23 -0
- data/unittests/map_test.rb +98 -0
- data/unittests/minmax_test.rb +37 -0
- data/unittests/navigate_test.rb +38 -0
- data/unittests/nbsp_xpath_test.rb +16 -0
- data/unittests/no_wait_test.rb +28 -0
- data/unittests/non_core_tests.rb +12 -0
- data/unittests/other/all_tests_concurrent.rb +57 -0
- data/unittests/other/navigate_exception_test.rb +24 -0
- data/unittests/other/rexml_unit_test.rb +27 -0
- data/unittests/other/screen_capture_test.rb +53 -0
- data/unittests/other/testcase_method_order_test.rb +36 -0
- data/unittests/other/testcase_verify_test.rb +25 -0
- data/unittests/other/wait_until_test.rb +102 -0
- data/unittests/pagecontainstext_test.rb +69 -0
- data/unittests/parent_child_test.rb +27 -0
- data/unittests/perf_test.rb +20 -0
- data/unittests/pre_test.rb +49 -0
- data/unittests/radios_test.rb +181 -0
- data/unittests/radios_xpath_test.rb +100 -0
- data/unittests/security_setting_test.rb +24 -0
- data/unittests/selectbox_test.rb +144 -0
- data/unittests/selectbox_xpath_test.rb +102 -0
- data/unittests/setup.rb +69 -0
- data/unittests/speed_settings_test.rb +67 -0
- data/unittests/table_cell_using_xpath_test.rb +34 -0
- data/unittests/table_test.rb +296 -0
- data/unittests/table_xpath_test.rb +109 -0
- data/unittests/test_tests.rb +9 -0
- data/unittests/textarea_test.rb +92 -0
- data/unittests/textarea_xpath_test.rb +77 -0
- data/unittests/textfield_for_ch_char_test.rb +32 -0
- data/unittests/textfields_test.rb +184 -0
- data/unittests/textfields_xpath_test.rb +110 -0
- data/unittests/version_test.rb +15 -0
- data/unittests/win32ole_so_test.rb +35 -0
- data/unittests/window_tests.rb +10 -0
- data/unittests/windows/attach_to_existing_window_test.rb +52 -0
- data/unittests/windows/attach_to_new_window_test.rb +74 -0
- data/unittests/windows/close_window_test.rb +20 -0
- data/unittests/windows/frame_links_test.rb +23 -0
- data/unittests/windows/ie-each_test.rb +46 -0
- data/unittests/windows/modal_dialog_test.rb +95 -0
- data/unittests/windows/new_process_test.rb +24 -0
- data/unittests/windows/new_test.rb +58 -0
- data/unittests/windows/open_close_test.rb +19 -0
- data/unittests/windows/send_keys_test.rb +26 -0
- data/unittests/xpath_tests.rb +11 -0
- data/watir-rdoc.rb +7 -0
- metadata +370 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for Tables
|
|
5
|
+
</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<br>
|
|
9
|
+
<br>
|
|
10
|
+
<table >
|
|
11
|
+
<tr>
|
|
12
|
+
<td> Row 1 Col1 </td>
|
|
13
|
+
<td> Row 1 Col2 </td>
|
|
14
|
+
</tr>
|
|
15
|
+
<tr>
|
|
16
|
+
<td> Row 2 Col1 </td>
|
|
17
|
+
<td> Row 2 Col2 </td>
|
|
18
|
+
</tr>
|
|
19
|
+
<tr>
|
|
20
|
+
<td> Row 3 Col1 </td>
|
|
21
|
+
<td> Row 3 Col2 </td>
|
|
22
|
+
</tr>
|
|
23
|
+
</table>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
simple table buttons
|
|
5
|
+
</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
|
|
9
|
+
<input type = text name="confirmtext">
|
|
10
|
+
<table >
|
|
11
|
+
<tr>
|
|
12
|
+
<td> <input type = button value = "Click" id = "b1" onClick = "document.all.confirmtext.value = 'CLICK1';"><td>Click1 </td>
|
|
13
|
+
</tr>
|
|
14
|
+
<tr>
|
|
15
|
+
<td> <input type = button value = "Click" onClick = "document.all.confirmtext.value = 'CLICK2';"><td>Click2 </td>
|
|
16
|
+
</tr>
|
|
17
|
+
<tr>
|
|
18
|
+
<td> <input type = button value = "Click" onClick = "document.all.confirmtext.value = 'CLICK3';">
|
|
19
|
+
<input type = button value = "Click too" onClick = "document.all.confirmtext.value = 'CLICK TOO';">
|
|
20
|
+
<td>Click3</td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<td> <input type = text value = "Im a text field" ></td>
|
|
24
|
+
</tr>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<tr>
|
|
28
|
+
<td>An input field and a button in the same cell<br> <input type = text name='same_cell' value = "Click ->" ><input type=button value = "Click To Change <-" onClick = "document.all.same_cell.value = '';" </td>
|
|
29
|
+
</tr>
|
|
30
|
+
|
|
31
|
+
</table>
|
|
32
|
+
|
|
33
|
+
This table has 3 images in each row. Each is a seperate cell
|
|
34
|
+
<table>
|
|
35
|
+
<tr>
|
|
36
|
+
<td><img src = images/1.gif><td><img src = images/2.gif><td><img src = images/3.gif>
|
|
37
|
+
<tr>
|
|
38
|
+
<td><img src = images/1.gif><td><img src = images/2.gif><td><img src = images/3.gif>
|
|
39
|
+
<tr>
|
|
40
|
+
<td><img src = images/1.gif><td><img src = images/2.gif><td><img src = images/3.gif>
|
|
41
|
+
</table>
|
|
42
|
+
|
|
43
|
+
This table has 3 images in each row. They are all in the same cell
|
|
44
|
+
<table>
|
|
45
|
+
<tr>
|
|
46
|
+
<td><img src = images/1.gif><img src = images/2.gif><img src = images/3.gif>
|
|
47
|
+
<tr>
|
|
48
|
+
<td><img src = images/1.gif><img src = images/2.gif><img src = images/3.gif>
|
|
49
|
+
<tr>
|
|
50
|
+
<td><img src = images/1.gif><img src = images/2.gif><img src = images/3.gif>
|
|
51
|
+
</table>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<style type="text/css">
|
|
55
|
+
div.hide { display: none; margin-left: auto; margin-right: auto; }
|
|
56
|
+
div.show { display: block; margin-left: auto; margin-right: auto; }
|
|
57
|
+
|
|
58
|
+
tr.hide { display: none; margin-left: auto; margin-right: auto; }
|
|
59
|
+
tr.show { display: block; margin-left: auto; margin-right: auto; }
|
|
60
|
+
|
|
61
|
+
</style>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
<script language=javascript>
|
|
65
|
+
|
|
66
|
+
function expand_or_shrink_row( row ) {
|
|
67
|
+
|
|
68
|
+
which_row = 'r' + row;
|
|
69
|
+
which_image = 'i' + row;
|
|
70
|
+
if ( document.getElementById(which_row).className=='hide' ){
|
|
71
|
+
document.getElementById(which_row).className='show';
|
|
72
|
+
document.getElementById(which_image).src='images/minus.gif';
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
document.getElementById(which_row).className='hide'
|
|
77
|
+
document.getElementById(which_image).src='images/plus.gif'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
The table below can show or hide its rows. Click the + (or -) to show or hide the row
|
|
85
|
+
<table id=show_hide>
|
|
86
|
+
<tr><td><img id=i1 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("1")'>
|
|
87
|
+
<tr class = hide id=r1><td>Line 1
|
|
88
|
+
<tr><td><img id=i2 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("2")'>
|
|
89
|
+
<tr class = hide id=r2><td>Line 2
|
|
90
|
+
<tr><td><img id=i3 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("3")'>
|
|
91
|
+
<tr class = hide id=r3><td>Line 3
|
|
92
|
+
<tr><td><img id=i4 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("4")'>
|
|
93
|
+
<tr class = hide id=r4><td>Line 4
|
|
94
|
+
<tr><td><img id=i5 width=30 height=30 src = images/plus.gif onClick='javascript:expand_or_shrink_row("5")'>
|
|
95
|
+
<tr class = hide id=r5><td>Line 5
|
|
96
|
+
</table>
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
</body>
|
|
103
|
+
|
|
104
|
+
</html>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for testing column value extraction
|
|
5
|
+
</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<br>
|
|
9
|
+
<br>
|
|
10
|
+
<b>Test page for testing column value extraction</b>
|
|
11
|
+
<br>
|
|
12
|
+
<br>
|
|
13
|
+
Single Column
|
|
14
|
+
<table border="1">
|
|
15
|
+
<tr>
|
|
16
|
+
<td>R1C1</td>
|
|
17
|
+
</tr>
|
|
18
|
+
<tr>
|
|
19
|
+
<td>R2C1</td>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr>
|
|
22
|
+
<td>R3C1</td>
|
|
23
|
+
</tr>
|
|
24
|
+
</table>
|
|
25
|
+
<br>
|
|
26
|
+
Multiple Column
|
|
27
|
+
<table border="1">
|
|
28
|
+
<tr>
|
|
29
|
+
<td>R1C1</td>
|
|
30
|
+
<td>R1C2</td>
|
|
31
|
+
<td>R1C3</td>
|
|
32
|
+
</tr>
|
|
33
|
+
<tr>
|
|
34
|
+
<td>R2C1</td>
|
|
35
|
+
<td>R2C2</td>
|
|
36
|
+
<td>R2C3</td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td>R3C1</td>
|
|
40
|
+
<td>R3C2</td>
|
|
41
|
+
<td>R3C3</td>
|
|
42
|
+
</tr>
|
|
43
|
+
</table>
|
|
44
|
+
<br>
|
|
45
|
+
Multiple Column With Jagged ColSpan
|
|
46
|
+
<table border="1">
|
|
47
|
+
<tr>
|
|
48
|
+
<td>R1C1</td>
|
|
49
|
+
<td>R1C2</td>
|
|
50
|
+
<td>R1C3</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td colspan="2">R2C1</td>
|
|
54
|
+
<td>R2C2</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr>
|
|
57
|
+
<td>R3C1</td>
|
|
58
|
+
<td>R3C2</td>
|
|
59
|
+
<td>R3C3</td>
|
|
60
|
+
</tr>
|
|
61
|
+
<tr>
|
|
62
|
+
<td colspan="3">R4C1</td>
|
|
63
|
+
</tr>
|
|
64
|
+
<tr>
|
|
65
|
+
<td rowspan="2">R5C1</td>
|
|
66
|
+
<td>R5C2</td>
|
|
67
|
+
<td>R5C3</td>
|
|
68
|
+
</tr>
|
|
69
|
+
<tr>
|
|
70
|
+
<td>R6C2</td>
|
|
71
|
+
<td>R6C3</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
</body>
|
|
75
|
+
</html>
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for Tables
|
|
5
|
+
</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
|
|
9
|
+
<style type="text/css">
|
|
10
|
+
table.sample {
|
|
11
|
+
border-width: 1px 1px 1px 1px;
|
|
12
|
+
border-spacing: 2px;
|
|
13
|
+
border-style: outset outset outset outset;
|
|
14
|
+
border-color: gray gray gray gray;
|
|
15
|
+
border-collapse: separate;
|
|
16
|
+
background-color: white;
|
|
17
|
+
}
|
|
18
|
+
table.sample th {
|
|
19
|
+
border-width: 1px 1px 1px 1px;
|
|
20
|
+
padding: 1px 1px 1px 1px;
|
|
21
|
+
border-style: inset inset inset inset;
|
|
22
|
+
border-color: gray gray gray gray;
|
|
23
|
+
background-color: white;
|
|
24
|
+
-moz-border-radius: 0px 0px 0px 0px;
|
|
25
|
+
}
|
|
26
|
+
table.sample td {
|
|
27
|
+
border-width: 1px 1px 1px 1px;
|
|
28
|
+
padding: 1px 1px 1px 1px;
|
|
29
|
+
border-style: inset inset inset inset;
|
|
30
|
+
border-color: gray gray gray gray;
|
|
31
|
+
background-color: white;
|
|
32
|
+
-moz-border-radius: 0px 0px 0px 0px;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
35
|
+
|
|
36
|
+
<script language=javascript>
|
|
37
|
+
|
|
38
|
+
function addRow() {
|
|
39
|
+
|
|
40
|
+
var tbody = document.getElementById('t1' ).getElementsByTagName("TBODY")[0];
|
|
41
|
+
|
|
42
|
+
// Create a TR
|
|
43
|
+
var row = document.createElement("TR");
|
|
44
|
+
row.setAttribute("class", "normal");
|
|
45
|
+
row.setAttribute("border", "1");
|
|
46
|
+
|
|
47
|
+
for (j=0 ; j < document.getElementById('t1' ).rows(1).cells.length; j++) {
|
|
48
|
+
// Create a TD
|
|
49
|
+
var td = document.createElement("TD");
|
|
50
|
+
td.setAttribute("border","1");
|
|
51
|
+
td.innerHTML = "New Cell";
|
|
52
|
+
|
|
53
|
+
// Assign TD to TR and then assign TR to TBODY
|
|
54
|
+
row.appendChild(td);
|
|
55
|
+
}
|
|
56
|
+
tbody.appendChild(row);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
</script>
|
|
60
|
+
<br>
|
|
61
|
+
<br>
|
|
62
|
+
<table >
|
|
63
|
+
<tr>
|
|
64
|
+
<td> Row 1 Col1
|
|
65
|
+
<td> Row 1 Col2
|
|
66
|
+
<tr>
|
|
67
|
+
<td> Row 2 Col1
|
|
68
|
+
<td> Row 2 Col2
|
|
69
|
+
</table>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<br>
|
|
73
|
+
<br>
|
|
74
|
+
<table id= 't1'>
|
|
75
|
+
<Tr><td colspan=2>Table 2
|
|
76
|
+
<tr>
|
|
77
|
+
<td id=cell1> Row 1 Col1
|
|
78
|
+
<td> Row 1 Col2
|
|
79
|
+
<tr id=row1>
|
|
80
|
+
<td> Row 2 Col1
|
|
81
|
+
<td> Row 2 Col2
|
|
82
|
+
<tr>
|
|
83
|
+
<td> Row 3 Col1
|
|
84
|
+
<td> Row 3 Col2
|
|
85
|
+
<tr>
|
|
86
|
+
<td> Row 4 Col1
|
|
87
|
+
<td> Row 4 Col2
|
|
88
|
+
|
|
89
|
+
</table>
|
|
90
|
+
<br>
|
|
91
|
+
<input type=button value='add row' onClick='javascript:addRow()'>
|
|
92
|
+
|
|
93
|
+
<br>
|
|
94
|
+
<br>
|
|
95
|
+
|
|
96
|
+
The following has a nested table
|
|
97
|
+
<table id='t2' border=1>
|
|
98
|
+
<tr>
|
|
99
|
+
<td>
|
|
100
|
+
cell 1
|
|
101
|
+
<td>
|
|
102
|
+
cell2
|
|
103
|
+
<tr>
|
|
104
|
+
<td>
|
|
105
|
+
<table><tr><td>nest1<td>nest2</table>
|
|
106
|
+
<td>
|
|
107
|
+
Normal
|
|
108
|
+
|
|
109
|
+
</table>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<br>
|
|
113
|
+
This table has 3 body tags. Mostly based on http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/tbody.asp?frame=true
|
|
114
|
+
<br><br>
|
|
115
|
+
<table id=body_test>
|
|
116
|
+
<THEAD>
|
|
117
|
+
<TR>
|
|
118
|
+
<TD>
|
|
119
|
+
This text is in the THEAD.
|
|
120
|
+
</TD>
|
|
121
|
+
</TR>
|
|
122
|
+
</THEAD>
|
|
123
|
+
<TBODY>
|
|
124
|
+
<TR>
|
|
125
|
+
<TD>
|
|
126
|
+
This text is in the FRST TBODY.
|
|
127
|
+
</TD>
|
|
128
|
+
</TR>
|
|
129
|
+
</TBODY>
|
|
130
|
+
|
|
131
|
+
<TBODY>
|
|
132
|
+
<TR>
|
|
133
|
+
<TD>
|
|
134
|
+
This text is in the SECOND TBODY.
|
|
135
|
+
</TD>
|
|
136
|
+
</TR>
|
|
137
|
+
<TR>
|
|
138
|
+
<TD>
|
|
139
|
+
This text is also in the SECOND TBODY.
|
|
140
|
+
</TD>
|
|
141
|
+
</TR>
|
|
142
|
+
</TBODY>
|
|
143
|
+
|
|
144
|
+
<TBODY>
|
|
145
|
+
<TR>
|
|
146
|
+
<TD>
|
|
147
|
+
This text is in the THIRD TBODY.
|
|
148
|
+
</TD>
|
|
149
|
+
</TR>
|
|
150
|
+
</TBODY>
|
|
151
|
+
|
|
152
|
+
</TABLE>
|
|
153
|
+
|
|
154
|
+
<table id=pic_table>
|
|
155
|
+
<tr>
|
|
156
|
+
<td> A picture is in the next cell
|
|
157
|
+
<td><img src=images/circle.jpg>
|
|
158
|
+
|
|
159
|
+
<td> A link is in the next cell
|
|
160
|
+
<td><a href = http://google.com>Google</a>
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
<table class="sample">
|
|
165
|
+
<tr>
|
|
166
|
+
<th>Header</th>
|
|
167
|
+
<td>First table with css class</td>
|
|
168
|
+
</tr>
|
|
169
|
+
</table>
|
|
170
|
+
|
|
171
|
+
<table class="sample">
|
|
172
|
+
<tr>
|
|
173
|
+
<td>Second table with css class</td>
|
|
174
|
+
</tr>
|
|
175
|
+
</table>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
</body>
|
|
179
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>Testing table cell using xpath.</title>
|
|
4
|
+
</head>
|
|
5
|
+
<body>
|
|
6
|
+
<table>
|
|
7
|
+
<tr>
|
|
8
|
+
<td colspan="1"><img src="images/square.jpg"> Table Cell with image of square.
|
|
9
|
+
</td>
|
|
10
|
+
<td colspan="2"><img src="images/triangle.jpg"> Table Cell with image of triangle.
|
|
11
|
+
</td>
|
|
12
|
+
<td colspan="3"><img src="images/circle.jpg"> Table Cell with image of circle.
|
|
13
|
+
</td>
|
|
14
|
+
<td colspan="4"><img src="images/button.jpg"> Table Cell with image of button.
|
|
15
|
+
</td>
|
|
16
|
+
</tr>
|
|
17
|
+
</table>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<style type="text/css">
|
|
4
|
+
table {
|
|
5
|
+
border-collapse: collapse;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
table, tr, td, th {
|
|
9
|
+
border-width: 1px;
|
|
10
|
+
border-style: solid;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
td {
|
|
14
|
+
width: 30px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
td.reddish {
|
|
18
|
+
color: red;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
<title>Watir::Table#to_a and Watir::TableRow#to_a</title>
|
|
22
|
+
</head>
|
|
23
|
+
|
|
24
|
+
<body>
|
|
25
|
+
<p>normal table</p>
|
|
26
|
+
<table id="normal">
|
|
27
|
+
<tr>
|
|
28
|
+
<td>1</td>
|
|
29
|
+
<td>2</td>
|
|
30
|
+
<td>3</td>
|
|
31
|
+
</tr>
|
|
32
|
+
<tr>
|
|
33
|
+
<td>4</td>
|
|
34
|
+
<td>5</td>
|
|
35
|
+
<td>6</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<tr>
|
|
38
|
+
<td>7</td>
|
|
39
|
+
<td>8</td>
|
|
40
|
+
<td class="reddish">9</td>
|
|
41
|
+
</tr>
|
|
42
|
+
</table>
|
|
43
|
+
|
|
44
|
+
<p>table with headers</p>
|
|
45
|
+
<table id="headers">
|
|
46
|
+
<tr>
|
|
47
|
+
<th>1</th>
|
|
48
|
+
<th>2</th>
|
|
49
|
+
<th>3</th>
|
|
50
|
+
<th>4</th>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>5</td>
|
|
54
|
+
<td>6</td>
|
|
55
|
+
<td>7</td>
|
|
56
|
+
<td>8</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td>9</td>
|
|
60
|
+
<td>10</td>
|
|
61
|
+
<td>11</td>
|
|
62
|
+
<td>12</td>
|
|
63
|
+
</tr>
|
|
64
|
+
</table>
|
|
65
|
+
|
|
66
|
+
<p>table with nested tables</p>
|
|
67
|
+
<table id="nested">
|
|
68
|
+
<tr>
|
|
69
|
+
<th>1</th>
|
|
70
|
+
<th>2</th>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<td>
|
|
74
|
+
<table>
|
|
75
|
+
<tr>
|
|
76
|
+
<th>11</th>
|
|
77
|
+
<th>12</th>
|
|
78
|
+
</tr>
|
|
79
|
+
<tr>
|
|
80
|
+
<td>13</td>
|
|
81
|
+
<td>14</td>
|
|
82
|
+
</tr>
|
|
83
|
+
</table>
|
|
84
|
+
</td>
|
|
85
|
+
<td>3</td>
|
|
86
|
+
</tr>
|
|
87
|
+
</table>
|
|
88
|
+
|
|
89
|
+
<p>table with nested table with non-direct child</p>
|
|
90
|
+
<table id="nestednondirectchild">
|
|
91
|
+
<tr>
|
|
92
|
+
<th>1</th>
|
|
93
|
+
<th>2</th>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td>
|
|
97
|
+
<span>
|
|
98
|
+
<table>
|
|
99
|
+
<tr>
|
|
100
|
+
<th>11</th>
|
|
101
|
+
<th>12</th>
|
|
102
|
+
</tr>
|
|
103
|
+
<tr>
|
|
104
|
+
<td>13</td>
|
|
105
|
+
<td>14</td>
|
|
106
|
+
</tr>
|
|
107
|
+
</table>
|
|
108
|
+
</span>
|
|
109
|
+
</td>
|
|
110
|
+
<td>3</td>
|
|
111
|
+
</tr>
|
|
112
|
+
</table>
|
|
113
|
+
|
|
114
|
+
<p>table with deep-nested tables</p>
|
|
115
|
+
<table id="deepnested">
|
|
116
|
+
<tr>
|
|
117
|
+
<th>1</th>
|
|
118
|
+
<th>2</th>
|
|
119
|
+
</tr>
|
|
120
|
+
<tr>
|
|
121
|
+
<td>
|
|
122
|
+
<table>
|
|
123
|
+
<tr>
|
|
124
|
+
<th>11</th>
|
|
125
|
+
<th>12</th>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td>
|
|
129
|
+
<table>
|
|
130
|
+
<tr>
|
|
131
|
+
<td>404</td>
|
|
132
|
+
<td>405</td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr>
|
|
135
|
+
<td>406</td>
|
|
136
|
+
<td>407</td>
|
|
137
|
+
</tr>
|
|
138
|
+
</table>
|
|
139
|
+
</td>
|
|
140
|
+
<td>14</td>
|
|
141
|
+
</tr>
|
|
142
|
+
</table>
|
|
143
|
+
</td>
|
|
144
|
+
<td>3</td>
|
|
145
|
+
</tr>
|
|
146
|
+
</table>
|
|
147
|
+
|
|
148
|
+
<p>table with colspan</p>
|
|
149
|
+
<table id="colspan">
|
|
150
|
+
<tr>
|
|
151
|
+
<th>1</th>
|
|
152
|
+
<th>2</th>
|
|
153
|
+
</tr>
|
|
154
|
+
<tr>
|
|
155
|
+
<td colspan="2">3</td>
|
|
156
|
+
</tr>
|
|
157
|
+
</table>
|
|
158
|
+
|
|
159
|
+
<p>table with rowspan</p>
|
|
160
|
+
<table id="rowspan">
|
|
161
|
+
<tr>
|
|
162
|
+
<th>1</th>
|
|
163
|
+
<th>2</th>
|
|
164
|
+
</tr>
|
|
165
|
+
<tr>
|
|
166
|
+
<td>3</td>
|
|
167
|
+
<td rowspan="2">4</td>
|
|
168
|
+
</tr>
|
|
169
|
+
<tr>
|
|
170
|
+
<td>5</td>
|
|
171
|
+
</tr>
|
|
172
|
+
</table>
|
|
173
|
+
</body>
|
|
174
|
+
</html>
|