firewatir 1.6.5 → 1.6.6.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +461 -0
- data/LICENSE +31 -31
- data/README.rdoc +112 -0
- data/VERSION +1 -0
- data/lib/firewatir.rb +41 -40
- data/lib/firewatir/container.rb +491 -491
- data/lib/firewatir/document.rb +239 -239
- data/lib/firewatir/element.rb +1364 -1364
- data/lib/firewatir/element_collections.rb +314 -314
- data/lib/firewatir/elements/button.rb +15 -15
- data/lib/firewatir/elements/file_field.rb +29 -29
- data/lib/firewatir/elements/form.rb +40 -40
- data/lib/firewatir/elements/frame.rb +55 -55
- data/lib/firewatir/elements/hidden.rb +56 -56
- data/lib/firewatir/elements/image.rb +139 -139
- data/lib/firewatir/elements/input_element.rb +44 -44
- data/lib/firewatir/elements/link.rb +76 -76
- data/lib/firewatir/elements/non_control_element.rb +53 -53
- data/lib/firewatir/elements/non_control_elements.rb +108 -108
- data/lib/firewatir/elements/not_used.rb +278 -278
- data/lib/firewatir/elements/option.rb +130 -130
- data/lib/firewatir/elements/radio_check_common.rb +163 -163
- data/lib/firewatir/elements/select_list.rb +188 -188
- data/lib/firewatir/elements/table.rb +218 -218
- data/lib/firewatir/elements/table_cell.rb +54 -54
- data/lib/firewatir/elements/table_row.rb +100 -100
- data/lib/firewatir/elements/text_field.rb +218 -218
- data/lib/firewatir/exceptions.rb +10 -10
- data/lib/firewatir/firefox.rb +984 -1040
- data/lib/firewatir/jssh_socket.rb +100 -100
- data/lib/firewatir/winClicker.rb +122 -122
- data/lib/firewatir/x11.rb +192 -192
- data/rakefile.rb +15 -0
- data/unittests/attach_to_new_window_test.rb +49 -49
- data/unittests/bug_fixes_test.rb +195 -195
- data/unittests/buttons_xpath_test.rb +88 -88
- data/unittests/checkbox_test.rb +158 -158
- data/unittests/checkbox_xpath_test.rb +107 -107
- data/unittests/div_test.rb +275 -275
- data/unittests/ff_test.rb +47 -0
- data/unittests/filefield_test.rb +49 -49
- data/unittests/filefield_xpath_test.rb +35 -35
- data/unittests/form_test.rb +296 -296
- data/unittests/frame_test.rb +159 -159
- data/unittests/hidden_test.rb +85 -85
- data/unittests/hidden_xpath_test.rb +72 -72
- data/unittests/html/JavascriptClick.html +42 -42
- data/unittests/html/blankpage.html +11 -11
- data/unittests/html/buttons1.html +61 -61
- data/unittests/html/checkboxes1.html +70 -70
- data/unittests/html/complex_table.html +36 -36
- data/unittests/html/cssTest.html +42 -42
- data/unittests/html/div.html +72 -72
- data/unittests/html/div_xml.html +20 -20
- data/unittests/html/fileupload.html +45 -45
- data/unittests/html/formTest1.html +38 -38
- data/unittests/html/forms2.html +45 -45
- data/unittests/html/forms3.html +132 -132
- data/unittests/html/forms4.html +27 -27
- data/unittests/html/frame_buttons.html +3 -3
- data/unittests/html/frame_links.html +3 -3
- data/unittests/html/frame_multi.html +4 -4
- data/unittests/html/iframeTest.html +14 -14
- data/unittests/html/iframeTest1.html +13 -13
- data/unittests/html/iframeTest2.html +5 -5
- data/unittests/html/images1.html +66 -66
- data/unittests/html/javascriptevents.html +35 -35
- data/unittests/html/link_pass.html +10 -10
- data/unittests/html/links1.html +42 -42
- data/unittests/html/links2.html +10 -10
- data/unittests/html/modal_dialog.html +8 -8
- data/unittests/html/modal_dialog_launcher.html +11 -11
- data/unittests/html/nestedFrames.html +6 -6
- data/unittests/html/new_browser.html +17 -17
- data/unittests/html/new_browser_popup.html +7 -7
- data/unittests/html/pass.html +9 -9
- data/unittests/html/popups1.html +60 -60
- data/unittests/html/pre.html +27 -27
- data/unittests/html/radioButtons1.html +70 -70
- data/unittests/html/redirect.html +10 -10
- data/unittests/html/redirect1.html +8 -8
- data/unittests/html/redirect2.html +8 -8
- data/unittests/html/redirect3.html +8 -8
- data/unittests/html/select_tealeaf.html +54 -54
- data/unittests/html/selectboxes1.html +55 -55
- data/unittests/html/simple_table.html +26 -26
- data/unittests/html/simple_table_buttons.html +104 -104
- data/unittests/html/simple_table_columns.html +74 -74
- data/unittests/html/table1.html +165 -165
- data/unittests/html/tableCell_using_xpath.html +19 -19
- data/unittests/html/textarea.html +30 -30
- data/unittests/html/textfields1.html +62 -62
- data/unittests/html/textsearch.html +44 -44
- data/unittests/images_test.rb +198 -198
- data/unittests/images_xpath_test.rb +118 -118
- data/unittests/javascript_test.rb +75 -75
- data/unittests/links_test.rb +231 -231
- data/unittests/links_xpath_test.rb +79 -79
- data/unittests/mozilla_all_tests.rb +7 -7
- data/unittests/pre_test.rb +75 -75
- data/unittests/radios_test.rb +166 -166
- data/unittests/radios_xpath_test.rb +101 -101
- data/unittests/redirect_test.rb +41 -41
- data/unittests/selectbox_test.rb +142 -142
- data/unittests/selectbox_xpath_test.rb +129 -129
- data/unittests/setup.rb +29 -29
- data/unittests/table_test.rb +385 -385
- data/unittests/table_xpath_test.rb +185 -185
- data/unittests/textfields_test.rb +234 -234
- data/unittests/textfields_xpath_test.rb +113 -113
- metadata +51 -19
- data/lib/firewatir/version.rb +0 -5
@@ -1,8 +1,8 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>New Browser Launcher</title>
|
4
|
-
</head>
|
5
|
-
<body>
|
6
|
-
PASS
|
7
|
-
</body>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>New Browser Launcher</title>
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
PASS
|
7
|
+
</body>
|
8
8
|
</html>
|
data/unittests/html/pass.html
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>
|
4
|
-
Pass Page
|
5
|
-
</title>
|
6
|
-
</head>
|
7
|
-
<body>
|
8
|
-
PASS
|
9
|
-
</body>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>
|
4
|
+
Pass Page
|
5
|
+
</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
PASS
|
9
|
+
</body>
|
10
10
|
</html>
|
data/unittests/html/popups1.html
CHANGED
@@ -1,60 +1,60 @@
|
|
1
|
-
<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
|
-
CVS Revision: "$Revision: 1.0 $"
|
30
|
-
<br>
|
31
|
-
<br>
|
32
|
-
<table>
|
33
|
-
|
34
|
-
<tr>
|
35
|
-
<td>
|
36
|
-
<input type = button value = "Alert" onClick = "javascript:alert('This is an alert box');">This Button shows an alert pop up</q>
|
37
|
-
<br>
|
38
|
-
|
39
|
-
<tr>
|
40
|
-
<td>
|
41
|
-
<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>
|
42
|
-
|
43
|
-
<br>
|
44
|
-
<tr>
|
45
|
-
<td>
|
46
|
-
<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>
|
47
|
-
<br>
|
48
|
-
|
49
|
-
<tr>
|
50
|
-
<td>
|
51
|
-
<input type = file name = up>This button shows a file upload box</q>
|
52
|
-
<br>
|
53
|
-
|
54
|
-
|
55
|
-
<tr>
|
56
|
-
<td>
|
57
|
-
</table>
|
58
|
-
|
59
|
-
|
60
|
-
</html>
|
1
|
+
<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
|
+
CVS Revision: "$Revision: 1.0 $"
|
30
|
+
<br>
|
31
|
+
<br>
|
32
|
+
<table>
|
33
|
+
|
34
|
+
<tr>
|
35
|
+
<td>
|
36
|
+
<input type = button value = "Alert" onClick = "javascript:alert('This is an alert box');">This Button shows an alert pop up</q>
|
37
|
+
<br>
|
38
|
+
|
39
|
+
<tr>
|
40
|
+
<td>
|
41
|
+
<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>
|
42
|
+
|
43
|
+
<br>
|
44
|
+
<tr>
|
45
|
+
<td>
|
46
|
+
<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>
|
47
|
+
<br>
|
48
|
+
|
49
|
+
<tr>
|
50
|
+
<td>
|
51
|
+
<input type = file name = up>This button shows a file upload box</q>
|
52
|
+
<br>
|
53
|
+
|
54
|
+
|
55
|
+
<tr>
|
56
|
+
<td>
|
57
|
+
</table>
|
58
|
+
|
59
|
+
|
60
|
+
</html>
|
data/unittests/html/pre.html
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
<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
|
-
</body>
|
1
|
+
<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
|
+
</body>
|
28
28
|
</html>
|
@@ -1,71 +1,71 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>
|
4
|
-
Test page for Radio Buttons
|
5
|
-
</title>
|
6
|
-
<link rel="stylesheet" type="text/css" href="firewatir_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
|
-
CVS Revision: $Revision $
|
21
|
-
<br>
|
22
|
-
<br>
|
23
|
-
<table>
|
24
|
-
<tr>
|
25
|
-
<td>
|
26
|
-
Radio (using name) <input type = radio name = box1 class='radio_style'>
|
27
|
-
<br>
|
28
|
-
Radio (using id) <input type = radio id = box5>
|
29
|
-
|
30
|
-
<tr>
|
31
|
-
<td>
|
32
|
-
Disabled<input type = radio name = box2 disabled>
|
33
|
-
|
34
|
-
<tr>
|
35
|
-
<td>
|
36
|
-
Set<input type = radio name = box3 checked>
|
37
|
-
|
38
|
-
<tr>
|
39
|
-
<td>
|
40
|
-
<br>
|
41
|
-
<br>
|
42
|
-
These radios have the same name, but different values
|
43
|
-
<br>
|
44
|
-
Name = box4 value=1 <input type = radio name = box4 value = 1 checked>
|
45
|
-
<br>
|
46
|
-
Name = box4 value=2 <input type = radio name = box4 value = 2>
|
47
|
-
<br>
|
48
|
-
Name = box4 value=3 <input type = radio name = box4 value = 3>
|
49
|
-
<br>
|
50
|
-
Name = box4 value=4 <input type = radio name = box4 value = 4>
|
51
|
-
<br>
|
52
|
-
Name = box4 value=5 <input type = radio name = box4 value = 5 disabled title="box4-value5">
|
53
|
-
|
54
|
-
|
55
|
-
<tr>
|
56
|
-
<td>
|
57
|
-
Name = box5 value=1 Enable Button <input type = radio name = box5 value = 1 onClick='javascript:setButtonState( )'>
|
58
|
-
<br>Name = box5 value=2 Disable Button<input type = radio name = box5 value = 2 onClick='javascript:setButtonState( )'>
|
59
|
-
|
60
|
-
|
61
|
-
<tr>
|
62
|
-
<td>
|
63
|
-
<input type = button name = foo value = foo disabled><td> This button is used with radio box5. This button gets enabled/disabled on each click
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
</table>
|
70
|
-
</body>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>
|
4
|
+
Test page for Radio Buttons
|
5
|
+
</title>
|
6
|
+
<link rel="stylesheet" type="text/css" href="firewatir_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
|
+
CVS Revision: $Revision $
|
21
|
+
<br>
|
22
|
+
<br>
|
23
|
+
<table>
|
24
|
+
<tr>
|
25
|
+
<td>
|
26
|
+
Radio (using name) <input type = radio name = box1 class='radio_style'>
|
27
|
+
<br>
|
28
|
+
Radio (using id) <input type = radio id = box5>
|
29
|
+
|
30
|
+
<tr>
|
31
|
+
<td>
|
32
|
+
Disabled<input type = radio name = box2 disabled>
|
33
|
+
|
34
|
+
<tr>
|
35
|
+
<td>
|
36
|
+
Set<input type = radio name = box3 checked>
|
37
|
+
|
38
|
+
<tr>
|
39
|
+
<td>
|
40
|
+
<br>
|
41
|
+
<br>
|
42
|
+
These radios have the same name, but different values
|
43
|
+
<br>
|
44
|
+
Name = box4 value=1 <input type = radio name = box4 value = 1 checked>
|
45
|
+
<br>
|
46
|
+
Name = box4 value=2 <input type = radio name = box4 value = 2>
|
47
|
+
<br>
|
48
|
+
Name = box4 value=3 <input type = radio name = box4 value = 3>
|
49
|
+
<br>
|
50
|
+
Name = box4 value=4 <input type = radio name = box4 value = 4>
|
51
|
+
<br>
|
52
|
+
Name = box4 value=5 <input type = radio name = box4 value = 5 disabled title="box4-value5">
|
53
|
+
|
54
|
+
|
55
|
+
<tr>
|
56
|
+
<td>
|
57
|
+
Name = box5 value=1 Enable Button <input type = radio name = box5 value = 1 onClick='javascript:setButtonState( )'>
|
58
|
+
<br>Name = box5 value=2 Disable Button<input type = radio name = box5 value = 2 onClick='javascript:setButtonState( )'>
|
59
|
+
|
60
|
+
|
61
|
+
<tr>
|
62
|
+
<td>
|
63
|
+
<input type = button name = foo value = foo disabled><td> This button is used with radio box5. This button gets enabled/disabled on each click
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
</table>
|
70
|
+
</body>
|
71
71
|
</html>
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>Firewatir redirect</title>
|
4
|
-
<meta content="2;div.html">
|
5
|
-
<meta content="2;div.html">
|
6
|
-
<meta content="2;div.html">
|
7
|
-
<meta name="test" content="2;div.html">
|
8
|
-
<meta http-equiv="refresh" content="2;div.html">
|
9
|
-
</head>
|
10
|
-
<body>Transferring to Divs page</body></html>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Firewatir redirect</title>
|
4
|
+
<meta content="2;div.html">
|
5
|
+
<meta content="2;div.html">
|
6
|
+
<meta content="2;div.html">
|
7
|
+
<meta name="test" content="2;div.html">
|
8
|
+
<meta http-equiv="refresh" content="2;div.html">
|
9
|
+
</head>
|
10
|
+
<body>Transferring to Divs page</body></html>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>Firewatir redirect</title>
|
4
|
-
<meta content="2;div.html">
|
5
|
-
<meta content="2;div.html">
|
6
|
-
<meta name="test" content="2;div.html">
|
7
|
-
<meta http-equiv="refresh" content="5;redirect2.html">
|
8
|
-
</head>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Firewatir redirect</title>
|
4
|
+
<meta content="2;div.html">
|
5
|
+
<meta content="2;div.html">
|
6
|
+
<meta name="test" content="2;div.html">
|
7
|
+
<meta http-equiv="refresh" content="5;redirect2.html">
|
8
|
+
</head>
|
9
9
|
<body>Transferring to redirect2.html for testing multiple redirects.</body></html>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>Firewatir redirect</title>
|
4
|
-
<meta content="2;div.html">
|
5
|
-
<meta content="2;div.html">
|
6
|
-
<meta content="2;div.html">
|
7
|
-
<meta http-equiv="refresh" content="2;redirect3.html">
|
8
|
-
</head>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Firewatir redirect</title>
|
4
|
+
<meta content="2;div.html">
|
5
|
+
<meta content="2;div.html">
|
6
|
+
<meta content="2;div.html">
|
7
|
+
<meta http-equiv="refresh" content="2;redirect3.html">
|
8
|
+
</head>
|
9
9
|
<body>Transferring to redirect3.html for testing multiple redirect.</body></html>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<title>Firewatir redirect</title>
|
4
|
-
<meta content="2;div.html">
|
5
|
-
<meta content="2;div.html">
|
6
|
-
<meta content="2;div.html">
|
7
|
-
<meta http-equiv="refresh" content="2;div.html">
|
8
|
-
</head>
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Firewatir redirect</title>
|
4
|
+
<meta content="2;div.html">
|
5
|
+
<meta content="2;div.html">
|
6
|
+
<meta content="2;div.html">
|
7
|
+
<meta http-equiv="refresh" content="2;div.html">
|
8
|
+
</head>
|
9
9
|
<body>Transferring to div.html for testing multiple redirect.</body></html>
|
@@ -1,54 +1,54 @@
|
|
1
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
-
<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>
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<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>
|