watir 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/readme.rb +211 -0
- data/unittests/WindowLogonExample.rb +30 -0
- data/unittests/WindowLogonExtra.rb +7 -0
- data/unittests/all_tests.rb +10 -0
- data/unittests/all_tests_concurrent.rb +57 -0
- data/unittests/attachToExistingWindow_test.rb +40 -0
- data/unittests/buttons_test.rb +131 -0
- data/unittests/checkbox_test.rb +149 -0
- data/unittests/core_tests.rb +9 -0
- data/unittests/css_test.rb +60 -0
- data/unittests/div_test.rb +179 -0
- data/unittests/errorchecker_test.rb +29 -0
- data/unittests/filefield_test.rb +35 -0
- data/unittests/form_test.rb +279 -0
- data/unittests/frame_test.rb +141 -0
- data/unittests/html/blankpage.html +12 -0
- data/unittests/html/buttons1.html +40 -0
- data/unittests/html/checkboxes1.html +69 -0
- data/unittests/html/complex_table.html +36 -0
- data/unittests/html/cssTest.html +42 -0
- data/unittests/html/div.html +105 -0
- data/unittests/html/fileupload.html +45 -0
- data/unittests/html/formTest1.html +39 -0
- data/unittests/html/forms2.html +45 -0
- data/unittests/html/forms3.html +132 -0
- data/unittests/html/forms4.html +27 -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/iframeTest.html +13 -0
- data/unittests/html/iframeTest1.html +7 -0
- data/unittests/html/iframeTest2.html +6 -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/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 +52 -0
- data/unittests/html/javascriptevents.html +39 -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/nestedFrames.html +6 -0
- data/unittests/html/pass.html +10 -0
- data/unittests/html/popups1.html +60 -0
- data/unittests/html/radioButtons1.html +71 -0
- data/unittests/html/select_tealeaf.html +54 -0
- data/unittests/html/selectboxes1.html +55 -0
- data/unittests/html/simple_table.html +26 -0
- data/unittests/html/simple_table_buttons.html +104 -0
- data/unittests/html/simple_table_columns.html +76 -0
- data/unittests/html/table1.html +142 -0
- data/unittests/html/textarea.html +30 -0
- data/unittests/html/textfields1.html +87 -0
- data/unittests/html/textsearch.html +44 -0
- data/unittests/ie_mock.rb +93 -0
- data/unittests/ie_test.rb +50 -0
- data/unittests/images_test.rb +179 -0
- data/unittests/iostring.rb +30 -0
- data/unittests/iostring_test.rb +48 -0
- data/unittests/js_events_test.rb +77 -0
- data/unittests/jscriptExtraAlert.rb +6 -0
- data/unittests/jscriptExtraConfirmCancel.rb +7 -0
- data/unittests/jscriptExtraConfirmOk.rb +7 -0
- data/unittests/jscriptPushButton.rb +5 -0
- data/unittests/jscript_test.rb +57 -0
- data/unittests/links_test.rb +169 -0
- data/unittests/minmax_test.rb +31 -0
- data/unittests/navigate_test.rb +56 -0
- data/unittests/non_core_tests.rb +9 -0
- data/unittests/pagecontainstext_test.rb +49 -0
- data/unittests/popups_test.rb +44 -0
- data/unittests/radios_test.rb +164 -0
- data/unittests/screen_capture_test.rb +53 -0
- data/unittests/selectbox_test.rb +197 -0
- data/unittests/send_keys_test.rb +29 -0
- data/unittests/setup.rb +47 -0
- data/unittests/table_test.rb +306 -0
- data/unittests/textAreafields_test.rb +81 -0
- data/unittests/textfields_test.rb +239 -0
- data/watir.rb +3744 -0
- data/watir/AutoItX3.dll +0 -0
- data/watir/WindowHelper.rb +47 -0
- data/watir/camel_case.rb +37 -0
- data/watir/clickJSDialog.rb +19 -0
- data/watir/cookiemanager.rb +53 -0
- data/watir/exceptions.rb +60 -0
- data/watir/screen_capture.rb +115 -0
- data/watir/setFileDialog.rb +16 -0
- data/watir/testUnitAddons.rb +47 -0
- data/watir/watir_simple.rb +475 -0
- data/watir/winClicker.rb +505 -0
- metadata +152 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Test page for forms</title>
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
CVS Revision: $Revision $
|
8
|
+
<br>
|
9
|
+
<br>
|
10
|
+
<table>
|
11
|
+
<tbody>
|
12
|
+
<tr>
|
13
|
+
<td>
|
14
|
+
<form name="apple_form" method="get" action="pass.html"> <input
|
15
|
+
name="name" value="apple" type="text"> </form>
|
16
|
+
</td>
|
17
|
+
</tr>
|
18
|
+
<tr>
|
19
|
+
<td>
|
20
|
+
<form name="banana_form" method="get" action="pass2.html"> <input
|
21
|
+
name="name" value="banana" type="text"> </form>
|
22
|
+
</td>
|
23
|
+
</tr>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<html>
|
2
|
+
<body>
|
3
|
+
<form name = sender>
|
4
|
+
<input type = text name = textToSend>
|
5
|
+
<input type = button name = sendIt value = "SendIt" onClick="javascript:parent.receiverFrame.document.body.all.receiverText.value= document.body.all.textToSend.value;">
|
6
|
+
</body>
|
7
|
+
<html>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>
|
4
|
+
Test page for Images
|
5
|
+
</title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
CVS Revision: "$Revision $"
|
9
|
+
<br>
|
10
|
+
<br>
|
11
|
+
<table>
|
12
|
+
<tr>
|
13
|
+
<td>
|
14
|
+
<img src = images/triangle.jpg>
|
15
|
+
<td> The triangle only has a src
|
16
|
+
|
17
|
+
<tr>
|
18
|
+
<td>
|
19
|
+
<img src = images/square.jpg id=square>
|
20
|
+
<td> The square has a src and an id
|
21
|
+
|
22
|
+
<tr>
|
23
|
+
<td>
|
24
|
+
<img src = images/circle.jpg name = circle>
|
25
|
+
<td> The circle has a src and a name
|
26
|
+
|
27
|
+
|
28
|
+
<tr>
|
29
|
+
<td>
|
30
|
+
<img src = images/missing.jpg name = themissingimage>
|
31
|
+
<td> this is a missing image
|
32
|
+
|
33
|
+
|
34
|
+
<tr>
|
35
|
+
<td>
|
36
|
+
<img src = images/button.jpg onClick='javascript:document.location="pass.html";'>
|
37
|
+
<td> this image has a javascript on click event
|
38
|
+
|
39
|
+
<tr>
|
40
|
+
<td>
|
41
|
+
<img src = images/circle.jpg alt="circle">
|
42
|
+
<td> The circle has a src and an alt text
|
43
|
+
|
44
|
+
<tr><td>
|
45
|
+
<INPUT onClick= javascript:document.all.text1.value='clicked' type=image src="images/square.jpg" value="Position Show Optional" name=tsogpsb>
|
46
|
+
<td> This is a button as an image, with a value attribute
|
47
|
+
<input type = text name = text1>
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
</body>
|
52
|
+
</html>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<HTML>
|
2
|
+
<HEAD>
|
3
|
+
<SCRIPT LANGUAGE="JavaScript">
|
4
|
+
|
5
|
+
function enable() {
|
6
|
+
frm=document.forms[0]
|
7
|
+
{frm.Button1.disabled=false}
|
8
|
+
}
|
9
|
+
|
10
|
+
</SCRIPT>
|
11
|
+
|
12
|
+
</HEAD>
|
13
|
+
<BODY TEXT="000000" BGCOLOR="FFFFFF">
|
14
|
+
<p align="center">
|
15
|
+
<form>
|
16
|
+
|
17
|
+
<input type="text" name="entertext" onkeyup="javascript:enable();" >
|
18
|
+
|
19
|
+
|
20
|
+
<input type=button value="Button 1" name="Button1" disabled="true" onClick="javascript:document.location='pass.html';">
|
21
|
+
|
22
|
+
</form>
|
23
|
+
</p>
|
24
|
+
<p>
|
25
|
+
<a href="pass.html"
|
26
|
+
onMouseOver="window.status='It worked'; return true">Check the Status</a>
|
27
|
+
|
28
|
+
</p>
|
29
|
+
<p>
|
30
|
+
<a href="pass.html"
|
31
|
+
onMouseOver="window.status=''; return true">Clear the Status</a>
|
32
|
+
|
33
|
+
</p>
|
34
|
+
|
35
|
+
<p>
|
36
|
+
<a href = '#' onClick= "javascript:window.open('pass.html','pop_up_test','height=100,width=50,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); ">New Window No Status Bar</a>
|
37
|
+
|
38
|
+
</BODY>
|
39
|
+
</HTML>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Test page for Links</title>
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
CVS Revision: $Revision $
|
8
|
+
<br>
|
9
|
+
<br>
|
10
|
+
<table>
|
11
|
+
<tbody>
|
12
|
+
<tr>
|
13
|
+
<td> <a href="links2.html">test1</a> <br>
|
14
|
+
<a href="link_pass.html">test1</a> <br>
|
15
|
+
<a href="pass3.html"><img src="images/button.jpg" border=0></a> The button is really a link <br>
|
16
|
+
<a href="textarea.html" target="_blank">new window</a> <a href="textarea.html" target="_blank">new window</a> </td>
|
17
|
+
</tr>
|
18
|
+
<tr>
|
19
|
+
<td> <a href="links1.HTML" id="link_id">Link Using an ID</a> </td>
|
20
|
+
</tr>
|
21
|
+
<tr>
|
22
|
+
<td> <a href="links1.HTML" name="link_name">Link Using a name</a>
|
23
|
+
</td>
|
24
|
+
</tr>
|
25
|
+
<tr>
|
26
|
+
<td> <a href="links1.HTML" title="link_title">Link Using a title</a>
|
27
|
+
</td>
|
28
|
+
</tr>
|
29
|
+
|
30
|
+
<tr>
|
31
|
+
<td><a href = pass.html><img src=images/triangle.jpg>Image and a text link</a>
|
32
|
+
</tr>
|
33
|
+
|
34
|
+
</tbody>
|
35
|
+
</table>
|
36
|
+
</body>
|
37
|
+
</html>
|
@@ -0,0 +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.1 $"
|
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>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>
|
4
|
+
Test page for Radio Buttons
|
5
|
+
</title>
|
6
|
+
|
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>
|
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
|
+
</html>
|
@@ -0,0 +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>
|