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,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<body>
|
|
3
|
+
|
|
4
|
+
<h4>An Unordered List:</h4>
|
|
5
|
+
<ul>
|
|
6
|
+
<li id='list1'>Coffee</li>
|
|
7
|
+
<li id='list2'>Tea</li>
|
|
8
|
+
<li id='list3'>Milk</li>
|
|
9
|
+
</ul>
|
|
10
|
+
|
|
11
|
+
<h4>An Ordered List:</h4>
|
|
12
|
+
<ol>
|
|
13
|
+
<li id='ordered1' name='x1'>Phil</li>
|
|
14
|
+
<li id='ordered2'>Bob</li>
|
|
15
|
+
<li id='ordered3'>Joe</li>
|
|
16
|
+
</ol>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for map areas
|
|
5
|
+
</title>
|
|
6
|
+
Test Page for Map Tests<br><br>
|
|
7
|
+
<link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<br>
|
|
11
|
+
<br>
|
|
12
|
+
<table width="500px" border="0" cellspacing="0" cellpadding="0">
|
|
13
|
+
<tr>
|
|
14
|
+
<td valign="top" align="LEFT"><img SRC="images/map.GIF" USEMAP="#maptest01" BORDER="0"></td>
|
|
15
|
+
<map ID="maptestid01" NAME="maptest01">
|
|
16
|
+
<AREA SHAPE=RECT COORDS="12,150,140,20" HREF="pass.html" ALT="Pass" >
|
|
17
|
+
<AREA SHAPE=RECT COORDS="325,150,153,20" HREF="simple_table_buttons.html" ALT="Table Buttons" >
|
|
18
|
+
<AREA SHAPE=RECT COORDS="333,150,500,20" HREF="images1.html" ALT="Images" >
|
|
19
|
+
</map>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr>
|
|
22
|
+
<td valign="top" align="LEFT"><img SRC="images/map2.gif" USEMAP="#maptest02" BORDER="0"></td>
|
|
23
|
+
<map ID="maptestid02" NAME="maptest02" custom="foo">
|
|
24
|
+
<AREA SHAPE=RECT COORDS="12,150,140,20" HREF="pass.html" ALT="Pass2" >
|
|
25
|
+
<AREA SHAPE=RECT COORDS="325,150,153,20" HREF="simple_table_buttons.html" ALT="Table Buttons2" >
|
|
26
|
+
<AREA SHAPE=RECT COORDS="333,150,500,20" HREF="images1.html" ALT="Images2" >
|
|
27
|
+
</map>
|
|
28
|
+
</tr>
|
|
29
|
+
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head><title>Modal Dialog</title></head>
|
|
3
|
+
|
|
4
|
+
<body>
|
|
5
|
+
<p>Enter some text:</p>
|
|
6
|
+
<input type="text" name="modal_text" />
|
|
7
|
+
<input type="button" value="Close" onClick="javascript:window.returnValue=modal_text.value; window.close();"/>
|
|
8
|
+
<br/><button onClick="showModalDialog('pass.html');">Another Modal</button>
|
|
9
|
+
<br/><button onClick="showModalDialog('frame_buttons.html');">Modal with Frames</button>
|
|
10
|
+
</body></html>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>Modal Browser Dialog Launcher</title>
|
|
4
|
+
</head>
|
|
5
|
+
<body>
|
|
6
|
+
<h1>Modal Browser Dialog Launcher</h1>
|
|
7
|
+
<input type = "button" value = "Launch Dialog" onclick = "javascript:document.all.modaloutput.value=window.showModalDialog('modal_dialog.html');"></input>
|
|
8
|
+
<br></br>
|
|
9
|
+
<p>Text from Modal:</p>
|
|
10
|
+
<input type = "text" name = "modaloutput"></input>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for multiple specifiers
|
|
5
|
+
</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<form name="testform" class="one">
|
|
9
|
+
<input type="button" name="testbutton" class="one"/>
|
|
10
|
+
<input type="button" name="testbutton" class="two"/>
|
|
11
|
+
|
|
12
|
+
<input type="text" name="testtext_field" class="one"/>
|
|
13
|
+
<input type="text" name="testtext_field" class="two"/>
|
|
14
|
+
|
|
15
|
+
<input type="file" name="testfile_field" class="one"/>
|
|
16
|
+
<input type="file" name="testfile_field" class="two"/>
|
|
17
|
+
|
|
18
|
+
<input type="hidden" name="testhidden" class="one"/>
|
|
19
|
+
<input type="hidden" name="testhidden" class="two"/>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" name="testcheckbox" class="one"/>
|
|
22
|
+
<input type="checkbox" name="testcheckbox" class="two"/>
|
|
23
|
+
|
|
24
|
+
<input type="radio" name="testradio" class="one"/>
|
|
25
|
+
<input type="radio" name="testradio" class="two"/>
|
|
26
|
+
|
|
27
|
+
<select name="testselect_list" class="one">
|
|
28
|
+
</select>
|
|
29
|
+
<select name="testselect_list" class="two">
|
|
30
|
+
</select>
|
|
31
|
+
</form>
|
|
32
|
+
|
|
33
|
+
<form name="testform" class="two">
|
|
34
|
+
</form>
|
|
35
|
+
|
|
36
|
+
<a href="#" name="testlink" class="one"></a>
|
|
37
|
+
<a href="#" name="testlink" class="two"></a>
|
|
38
|
+
|
|
39
|
+
<img src="#" name="testimage" class="one"/>
|
|
40
|
+
<img src="#" name="testimage" class="two"/>
|
|
41
|
+
|
|
42
|
+
<div name="testdiv" class="one"></div>
|
|
43
|
+
<div name="testdiv" class="two"></div>
|
|
44
|
+
|
|
45
|
+
<span name="testelement" class="one"></span>
|
|
46
|
+
<span name="testelement" class="two"></span>
|
|
47
|
+
|
|
48
|
+
<table name="testtable" class="one">
|
|
49
|
+
<tr name="testrow" class="one">
|
|
50
|
+
<td name="testcell" class="one">
|
|
51
|
+
</td>
|
|
52
|
+
<td name="testcell" class="two">
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr name="testrow" class="two">
|
|
56
|
+
</tr>
|
|
57
|
+
</table>
|
|
58
|
+
|
|
59
|
+
<table name="testtable" class="two">
|
|
60
|
+
</table>
|
|
61
|
+
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|
|
64
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>New Browser Launcher</title>
|
|
4
|
+
<script language="JavaScript" type="">
|
|
5
|
+
function open_window_slowly(){
|
|
6
|
+
setTimeout("window.open('blankpage.html');", document.all.delay.value * 1000);
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<h1>New Browser Launcher</h1>
|
|
12
|
+
<p>This link brings up a window marked "pass": <a href="pass.html" target="_blank">New Window</a></p>
|
|
13
|
+
<p>This link brings up a window marked "blank for frames" after a delay:
|
|
14
|
+
<span onclick="open_window_slowly();">New Window Slowly</span></p>
|
|
15
|
+
<p> Number of seconds to wait: <input type="text" name="delay" value="0.5"></input></p>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for pop ups
|
|
5
|
+
</title>
|
|
6
|
+
|
|
7
|
+
<script language = javascript>
|
|
8
|
+
function doConfirmBox() {
|
|
9
|
+
var a =confirm('Do you really want to do this');
|
|
10
|
+
if (a == true)
|
|
11
|
+
document.all.confirmtext.value = "OK"
|
|
12
|
+
else
|
|
13
|
+
document.all.confirmtext.value = "Cancel";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function doPromptBox() {
|
|
17
|
+
var a =prompt('Enter something delightful' , '');
|
|
18
|
+
if (a == null)
|
|
19
|
+
document.all.prompttext.value = "Cancel"
|
|
20
|
+
else
|
|
21
|
+
document.all.prompttext.value = a;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<br>
|
|
30
|
+
<br>
|
|
31
|
+
<table>
|
|
32
|
+
|
|
33
|
+
<tr>
|
|
34
|
+
<td>
|
|
35
|
+
<input type = button value = "Alert" onClick = "javascript:alert('This is an alert box');">This Button shows an alert pop up</q>
|
|
36
|
+
<br>
|
|
37
|
+
|
|
38
|
+
<tr>
|
|
39
|
+
<td>
|
|
40
|
+
<input type = button value = "Prompt" onClick= "javascript:doPromptBox();">This button shows a prompt pop up. This text box shows what text was entered <input type = text name = prompttext>
|
|
41
|
+
|
|
42
|
+
<br>
|
|
43
|
+
<tr>
|
|
44
|
+
<td>
|
|
45
|
+
<input type = button value = "Confirm" onClick= "javascript:doConfirmBox();">This button shows a prompt pop up. This text box shows which button was clicked <input type = text name = confirmtext>
|
|
46
|
+
<br>
|
|
47
|
+
|
|
48
|
+
<tr>
|
|
49
|
+
<td>
|
|
50
|
+
<input type = file name = up>This button shows a file upload box</q>
|
|
51
|
+
<br>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<tr>
|
|
55
|
+
<td>
|
|
56
|
+
</table>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</html>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>PRE tag tests</title>
|
|
4
|
+
</head>
|
|
5
|
+
<body>
|
|
6
|
+
Pre Tag Test
|
|
7
|
+
<br><br>
|
|
8
|
+
<pre id='1' name='1'>
|
|
9
|
+
This is a simple pre space
|
|
10
|
+
|
|
11
|
+
it should work well
|
|
12
|
+
|
|
13
|
+
just making sure
|
|
14
|
+
</pre>
|
|
15
|
+
<hr>
|
|
16
|
+
<pre id='2' name='2'>
|
|
17
|
+
<blockquote>
|
|
18
|
+
A second block
|
|
19
|
+
good to test with
|
|
20
|
+
</blockquote>
|
|
21
|
+
</pre>
|
|
22
|
+
<hr>
|
|
23
|
+
<pre id='3' name='3'>
|
|
24
|
+
this is the last block and it should
|
|
25
|
+
continue to work no matter what
|
|
26
|
+
</pre>
|
|
27
|
+
<p id='3' name='3'/>
|
|
28
|
+
</body>
|
|
29
|
+
</html>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for Radio Buttons
|
|
5
|
+
</title>
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
|
|
7
|
+
<script>
|
|
8
|
+
|
|
9
|
+
function setButtonState( )
|
|
10
|
+
{
|
|
11
|
+
if (document.all.foo.disabled )
|
|
12
|
+
document.all.foo.disabled = false
|
|
13
|
+
else
|
|
14
|
+
document.all.foo.disabled = true
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<br>
|
|
21
|
+
<br>
|
|
22
|
+
<table>
|
|
23
|
+
<tr>
|
|
24
|
+
<td>
|
|
25
|
+
Radio (using name) <input type = radio name = box1 class='radio_style'>
|
|
26
|
+
<br>
|
|
27
|
+
Radio (using id) <input type = radio id = box5>
|
|
28
|
+
|
|
29
|
+
<tr>
|
|
30
|
+
<td>
|
|
31
|
+
Disabled<input type = radio name = box2 disabled>
|
|
32
|
+
|
|
33
|
+
<tr>
|
|
34
|
+
<td>
|
|
35
|
+
Set<input type = radio name = box3 checked>
|
|
36
|
+
|
|
37
|
+
<tr>
|
|
38
|
+
<td>
|
|
39
|
+
<br>
|
|
40
|
+
<br>
|
|
41
|
+
These radios have the same name, but different values
|
|
42
|
+
<br>
|
|
43
|
+
Name = box4 value=1 <input type = radio name = box4 value = 1 checked>
|
|
44
|
+
<br>
|
|
45
|
+
Name = box4 value=2 <input type = radio name = box4 value = 2>
|
|
46
|
+
<br>
|
|
47
|
+
Name = box4 value=3 <input type = radio name = box4 value = 3>
|
|
48
|
+
<br>
|
|
49
|
+
Name = box4 value=4 <input type = radio name = box4 value = 4>
|
|
50
|
+
<br>
|
|
51
|
+
Name = box4 value=5 <input type = radio name = box4 value = 5 disabled title="box4-value5">
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<tr>
|
|
55
|
+
<td>
|
|
56
|
+
Name = box5 value=1 Enable Button <input type = radio name = box5 value = 1 onClick='javascript:setButtonState( )'>
|
|
57
|
+
<br>Name = box5 value=2 Disable Button<input type = radio name = box5 value = 2 onClick='javascript:setButtonState( )'>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<tr>
|
|
61
|
+
<td>
|
|
62
|
+
<input type = button name = foo value = foo disabled><td> This button is used with radio box5. This button gets enabled/disabled on each click
|
|
63
|
+
|
|
64
|
+
<tr>
|
|
65
|
+
<td><input type = radio name="box6" value="Tea">Tea</td>
|
|
66
|
+
<td><input type = radio name="box6" value="Milk">Milk</td>
|
|
67
|
+
</tr>
|
|
68
|
+
|
|
69
|
+
</table>
|
|
70
|
+
</body>
|
|
71
|
+
</html>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<head>
|
|
4
|
+
</head>
|
|
5
|
+
<body>
|
|
6
|
+
I've been very happy to be able to start migrating from Incanica's ITP<br>
|
|
7
|
+
to Watir at work, but I've run into my first real problem. I have a<br>
|
|
8
|
+
select box defined thus:<br>
|
|
9
|
+
<br>
|
|
10
|
+
<select class="body" name="op_numhits">
|
|
11
|
+
<option value="0"> = </option>
|
|
12
|
+
<option value="1"> <> </option>
|
|
13
|
+
<option value="3"> >= </option>
|
|
14
|
+
<option value="5"> <= </option>
|
|
15
|
+
</select>
|
|
16
|
+
<br>
|
|
17
|
+
and I'm trying to choose the ">=" option via the following code:<br>
|
|
18
|
+
<pre> $ie.selectBox( :name, "op_numhits" ).select( ">=" )</pre>
|
|
19
|
+
(Aside: actually, what I write to define the task is XML adapted from
|
|
20
|
+
ITP's syntax, e.g.,<br>
|
|
21
|
+
<pre> <browser_action entity="selectBox" entity_id_type="name" entity_id_value="op_numhits" action="select" param="&gt;=" /> </pre>
|
|
22
|
+
and our WebSiteTester Ruby class translates that into
|
|
23
|
+
Watir calls.)<br>
|
|
24
|
+
<br>
|
|
25
|
+
and the output I get from Watir is:<br>
|
|
26
|
+
<br>
|
|
27
|
+
Setting box op_numhits to >= String<br>
|
|
28
|
+
comparing >= to á=áá<br>
|
|
29
|
+
comparing >= to á<>á<br>
|
|
30
|
+
comparing >= to á>=á<br>
|
|
31
|
+
comparing >= to á<=á<br>
|
|
32
|
+
<br>
|
|
33
|
+
<br>
|
|
34
|
+
While I just realized I could enhance our WebSiteTester class to be
|
|
35
|
+
able to pass Regexp's as well as Strings to the select() method, it
|
|
36
|
+
would also be nice to be able to specify the desired select option by
|
|
37
|
+
value (in my example, the value is "3").<br>
|
|
38
|
+
<hr><br>
|
|
39
|
+
Is it even possible for Watir to select something based on an attribute<br>
|
|
40
|
+
that's empty, like the first option of the select box below? I know I<br>
|
|
41
|
+
also have an issue given that I'm translating from an XML representation<br>
|
|
42
|
+
to a Ruby Watir call, and I'm probably getting a nil back from REXML<br>
|
|
43
|
+
when I ask for the value of an attribute that has nothing between the<br>
|
|
44
|
+
quotes....<br>
|
|
45
|
+
<br>
|
|
46
|
+
<select class="body" name="s_interest" id="s_interest">
|
|
47
|
+
<option value="" selected="Y"></option>
|
|
48
|
+
<option value="-1">Yes</option>
|
|
49
|
+
<option value="0">No</option>
|
|
50
|
+
</select>
|
|
51
|
+
<br>
|
|
52
|
+
<br>
|
|
53
|
+
</body>
|
|
54
|
+
</html>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>
|
|
4
|
+
Test page for select boxes
|
|
5
|
+
</title>
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="watir_unit_tests.css">
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<br>
|
|
10
|
+
<br>
|
|
11
|
+
<table>
|
|
12
|
+
|
|
13
|
+
<tr>
|
|
14
|
+
<td>
|
|
15
|
+
<select name = "sel1" class='list_style'>
|
|
16
|
+
<option value=o1 >Option 1
|
|
17
|
+
<option value=o2 >Option 2
|
|
18
|
+
<option value=o3 SELECTED >Option 3
|
|
19
|
+
<option value=o4 >Option 4
|
|
20
|
+
</select>
|
|
21
|
+
<tr>
|
|
22
|
+
<td>
|
|
23
|
+
<select name = sel2 multiple>
|
|
24
|
+
<option value=o1 >Option 1
|
|
25
|
+
<option value=o2 class='option_style'>Option 2
|
|
26
|
+
<option value=o3 class='option_style' SELECTED >Option 3
|
|
27
|
+
<option value=o4 class='option_style'>Option 4
|
|
28
|
+
<option value=o6 class='option_style'>Option 5
|
|
29
|
+
<option value=o6 class='option_style' SELECTED >Option 6
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
</form>
|
|
33
|
+
|
|
34
|
+
<tr>
|
|
35
|
+
<td>
|
|
36
|
+
<select name = sel3 onChange = 'javascript:document.location="pass.html";'>
|
|
37
|
+
<option value = o1>Option 1
|
|
38
|
+
<option value = o2>Option 2
|
|
39
|
+
<option value = o3 selected>Option 3
|
|
40
|
+
<option value = o4>Option 4
|
|
41
|
+
</select>
|
|
42
|
+
|
|
43
|
+
<td> This box is used for testing the onchange event
|
|
44
|
+
|
|
45
|
+
<tr>
|
|
46
|
+
<td><select id = 'selectbox_4' disabled><option value = o1>Option 1<option value = o2>Option 2
|
|
47
|
+
|
|
48
|
+
<td>This box has an id
|
|
49
|
+
|
|
50
|
+
</table>
|
|
51
|
+
|
|
52
|
+
</html>
|