sapphire 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire.rb +38 -37
- data/lib/sapphire/Adapters.rb +1 -0
- data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +190 -0
- data/lib/sapphire/DSL.rb +6 -6
- data/lib/sapphire/DSL/Browser/Accept.rb +9 -9
- data/lib/sapphire/DSL/Browser/AlertBox.rb +14 -19
- data/lib/sapphire/DSL/Browser/Browser.rb +17 -17
- data/lib/sapphire/DSL/Browser/By.rb +10 -10
- data/lib/sapphire/DSL/Browser/Check.rb +12 -12
- data/lib/sapphire/DSL/Browser/Clear.rb +12 -12
- data/lib/sapphire/DSL/Browser/Click.rb +12 -12
- data/lib/sapphire/DSL/Browser/Close.rb +12 -12
- data/lib/sapphire/DSL/Browser/Compare.rb +18 -18
- data/lib/sapphire/DSL/Browser/Complete.rb +15 -15
- data/lib/sapphire/DSL/Browser/CurrentUrl.rb +11 -11
- data/lib/sapphire/DSL/Browser/Day.rb +24 -24
- data/lib/sapphire/DSL/Browser/Differ.rb +18 -18
- data/lib/sapphire/DSL/Browser/Error.rb +26 -26
- data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +45 -45
- data/lib/sapphire/DSL/Browser/Exists.rb +22 -22
- data/lib/sapphire/DSL/Browser/For.rb +10 -10
- data/lib/sapphire/DSL/Browser/Hide.rb +26 -26
- data/lib/sapphire/DSL/Browser/IsHidden.rb +10 -10
- data/lib/sapphire/DSL/Browser/IsVisible.rb +33 -33
- data/lib/sapphire/DSL/Browser/Keys/Enter.rb +10 -10
- data/lib/sapphire/DSL/Browser/Month.rb +24 -24
- data/lib/sapphire/DSL/Browser/MouseOver.rb +12 -12
- data/lib/sapphire/DSL/Browser/Navigate.rb +11 -11
- data/lib/sapphire/DSL/Browser/Popup.rb +2 -4
- data/lib/sapphire/DSL/Browser/Press.rb +10 -10
- data/lib/sapphire/DSL/Browser/Reload.rb +11 -11
- data/lib/sapphire/DSL/Browser/Set.rb +18 -18
- data/lib/sapphire/DSL/Browser/Should.rb +42 -42
- data/lib/sapphire/DSL/Browser/Show.rb +26 -26
- data/lib/sapphire/DSL/Browser/Start.rb +16 -16
- data/lib/sapphire/DSL/Browser/To.rb +10 -10
- data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
- data/lib/sapphire/DSL/Browser/Transition.rb +26 -26
- data/lib/sapphire/DSL/Browser/Uncheck.rb +12 -12
- data/lib/sapphire/DSL/Browser/With.rb +10 -10
- data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
- data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
- data/lib/sapphire/DSL/Configuration/Use.rb +15 -15
- data/lib/sapphire/DSL/Data/Exist.rb +27 -27
- data/lib/sapphire/DSL/Data/Find.rb +10 -10
- data/lib/sapphire/DSL/Data/GetPageField.rb +17 -17
- data/lib/sapphire/DSL/Data/Underscore.rb +8 -8
- data/lib/sapphire/DSL/Data/Validate.rb +26 -26
- data/lib/sapphire/DSL/Data/Verify.rb +10 -10
- data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
- data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
- data/lib/sapphire/DSL/Scenarios/and.rb +25 -25
- data/lib/sapphire/DSL/Scenarios/background.rb +33 -33
- data/lib/sapphire/DSL/Scenarios/dsl.rb +59 -59
- data/lib/sapphire/DSL/Scenarios/finally.rb +33 -33
- data/lib/sapphire/DSL/Scenarios/given.rb +57 -57
- data/lib/sapphire/DSL/Scenarios/runner.rb +40 -40
- data/lib/sapphire/DSL/Scenarios/scenario.rb +53 -53
- data/lib/sapphire/DSL/Scenarios/then.rb +34 -34
- data/lib/sapphire/DSL/Scenarios/when.rb +47 -47
- data/lib/sapphire/Data.rb +1 -1
- data/lib/sapphire/DataAbstractions/Database.rb +57 -57
- data/lib/sapphire/DataAbstractions/Query.rb +19 -19
- data/lib/sapphire/JobAbstractions/Job.rb +32 -32
- data/lib/sapphire/Strategies.rb +1 -1
- data/lib/sapphire/TeamCity.rb +8 -8
- data/lib/sapphire/Testing.rb +2 -2
- data/lib/sapphire/Testing/Executable.rb +30 -30
- data/lib/sapphire/Testing/RakeTask.rb +108 -108
- data/lib/sapphire/Testing/ResultList.rb +18 -18
- data/lib/sapphire/Testing/ResultTree.rb +44 -44
- data/lib/sapphire/Testing/ScenarioResult.rb +36 -36
- data/lib/sapphire/Testing/TestResult.rb +21 -21
- data/lib/sapphire/Testing/TestRunnerAdapter.rb +69 -69
- data/lib/sapphire/Virtualization.rb +7 -7
- data/lib/sapphire/Web.rb +3 -6
- data/lib/sapphire/WebAbstractions/{Controls/Browsers → Browsers}/Chrome.rb +21 -21
- data/lib/sapphire/WebAbstractions/{Controls/Browsers → Browsers}/FireFox.rb +22 -22
- data/lib/sapphire/WebAbstractions/{Controls/Browsers → Browsers}/InternetExplorer.rb +21 -21
- data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +59 -99
- data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +62 -62
- data/lib/sapphire/WebAbstractions/Controls/Button.rb +9 -9
- data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +28 -28
- data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
- data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +26 -26
- data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/Image.rb +9 -9
- data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +18 -18
- data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +31 -31
- data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
- data/lib/sapphire/version.rb +3 -3
- metadata +14 -13
- data/lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb +0 -91
@@ -1,21 +1,21 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module WebAbstractions
|
3
|
-
def InternetExplorer(url)
|
4
|
-
driver = InternetExplorerBrowser.new
|
5
|
-
driver
|
6
|
-
end
|
7
|
-
|
8
|
-
class InternetExplorerBrowser
|
9
|
-
include
|
10
|
-
|
11
|
-
attr_reader :browser
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
@browser =
|
15
|
-
super(@browser)
|
16
|
-
$browser =
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
1
|
+
module Sapphire
|
2
|
+
module WebAbstractions
|
3
|
+
def InternetExplorer(url)
|
4
|
+
driver = InternetExplorerBrowser.new
|
5
|
+
driver
|
6
|
+
end
|
7
|
+
|
8
|
+
class InternetExplorerBrowser
|
9
|
+
include RubySeleniumWebDriver
|
10
|
+
|
11
|
+
attr_reader :browser
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@browser = self.Create :ie
|
15
|
+
super(@browser)
|
16
|
+
$browser = self
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -1,99 +1,59 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module WebAbstractions
|
3
|
-
class Control
|
4
|
-
def initialize(browser, hash)
|
5
|
-
@browser = browser
|
6
|
-
@hash = hash
|
7
|
-
end
|
8
|
-
|
9
|
-
def Find
|
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
|
-
@hash.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
def Text
|
62
|
-
text = self.Find
|
63
|
-
text.text
|
64
|
-
end
|
65
|
-
|
66
|
-
def Click
|
67
|
-
control = self.Find
|
68
|
-
control.click
|
69
|
-
end
|
70
|
-
|
71
|
-
def MouseOver
|
72
|
-
if @hash.is_a? Hash
|
73
|
-
if(@hash.has_key?(:id))
|
74
|
-
@browser.execute_script("document.getElementById('"+ @hash.fetch(:id) +"').style.visibility = 'visible'; ")
|
75
|
-
elsif (@hash.has_key?(:name))
|
76
|
-
@browser.execute_script("document.getElementByName('"+ @hash.fetch(:name) +"').style.visibility = 'visible'; ")
|
77
|
-
elsif (@hash.has_key?(:xpath))
|
78
|
-
@browser.execute_script("document.evaluate( '" + @hash.fetch(:xpath) + "', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.visibility = 'visible'; ")
|
79
|
-
end
|
80
|
-
elsif @hash.is_a? Array
|
81
|
-
if(@hash[0].has_key?(:id))
|
82
|
-
@browser.execute_script("document.getElementById('"+ @hash[0].fetch(:id) +"').style.visibility = 'visible'; ")
|
83
|
-
elsif (@hash[0].has_key?(:name))
|
84
|
-
@browser.execute_script("document.getElementByName('"+ @hash[0].fetch(:name) +"').style.visibility = 'visible'; ")
|
85
|
-
elsif (@hash[0].has_key?(:xpath))
|
86
|
-
@browser.execute_script("document.evaluate( '" + @hash[0].fetch(:xpath) + "', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.visibility = 'visible'; ")
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
sleep(1)
|
91
|
-
end
|
92
|
-
|
93
|
-
def Equals(value)
|
94
|
-
Evaluation.new(self.Text, value)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
1
|
+
module Sapphire
|
2
|
+
module WebAbstractions
|
3
|
+
class Control
|
4
|
+
def initialize(browser, hash)
|
5
|
+
@browser = browser
|
6
|
+
@hash = hash
|
7
|
+
end
|
8
|
+
|
9
|
+
def Find
|
10
|
+
@browser.FindItem(@hash)
|
11
|
+
end
|
12
|
+
|
13
|
+
def FindAll
|
14
|
+
@browser.FindAllItems(@hash)
|
15
|
+
end
|
16
|
+
|
17
|
+
def FindWithoutWait
|
18
|
+
@browser.FindElement @hash[0].keys.first, @hash[0].fetch(@hash[0].keys.first)
|
19
|
+
end
|
20
|
+
|
21
|
+
def Text
|
22
|
+
text = self.Find
|
23
|
+
text.text
|
24
|
+
end
|
25
|
+
|
26
|
+
def Click
|
27
|
+
control = self.Find
|
28
|
+
control.click
|
29
|
+
end
|
30
|
+
|
31
|
+
def MouseOver
|
32
|
+
if @hash.is_a? Hash
|
33
|
+
if(@hash.has_key?(:id))
|
34
|
+
@browser.ExecuteScript("document.getElementById('"+ @hash.fetch(:id) +"').style.visibility = 'visible'; ")
|
35
|
+
elsif (@hash.has_key?(:name))
|
36
|
+
@browser.ExecuteScript("document.getElementByName('"+ @hash.fetch(:name) +"').style.visibility = 'visible'; ")
|
37
|
+
elsif (@hash.has_key?(:xpath))
|
38
|
+
@browser.ExecuteScript("document.evaluate( '" + @hash.fetch(:xpath) + "', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.visibility = 'visible'; ")
|
39
|
+
end
|
40
|
+
elsif @hash.is_a? Array
|
41
|
+
if(@hash[0].has_key?(:id))
|
42
|
+
@browser.ExecuteScript("document.getElementById('"+ @hash[0].fetch(:id) +"').style.visibility = 'visible'; ")
|
43
|
+
elsif (@hash[0].has_key?(:name))
|
44
|
+
@browser.ExecuteScript("document.getElementByName('"+ @hash[0].fetch(:name) +"').style.visibility = 'visible'; ")
|
45
|
+
elsif (@hash[0].has_key?(:xpath))
|
46
|
+
@browser.ExecuteScript("document.evaluate( '" + @hash[0].fetch(:xpath) + "', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.visibility = 'visible'; ")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
sleep(1)
|
51
|
+
end
|
52
|
+
|
53
|
+
def Equals(value)
|
54
|
+
Evaluation.new(self.Text, value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
@@ -1,62 +1,62 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module WebAbstractions
|
3
|
-
class Page
|
4
|
-
|
5
|
-
def AlternateUrls
|
6
|
-
[]
|
7
|
-
end
|
8
|
-
|
9
|
-
attr_reader :fields
|
10
|
-
|
11
|
-
def initialize(browser)
|
12
|
-
@browser = browser
|
13
|
-
@fields = []
|
14
|
-
end
|
15
|
-
|
16
|
-
def DropDown(*args)
|
17
|
-
@fields << { args.first => DropDown.new(@browser, args[1..args.length]) }
|
18
|
-
end
|
19
|
-
|
20
|
-
def TextBox(*args)
|
21
|
-
@fields << { args.first => TextBox.new(@browser, args[1..args.length]) }
|
22
|
-
end
|
23
|
-
|
24
|
-
def RadioButton(*args)
|
25
|
-
@fields << { args.first => RadioButton.new(@browser, args[1..args.length]) }
|
26
|
-
end
|
27
|
-
|
28
|
-
def CheckBox(*args)
|
29
|
-
@fields << { args.first => CheckBox.new(@browser, args[1..args.length]) }
|
30
|
-
end
|
31
|
-
|
32
|
-
def Button(*args)
|
33
|
-
@fields << { args.first => Button.new(@browser, args[1..args.length]) }
|
34
|
-
end
|
35
|
-
|
36
|
-
def Label(*args)
|
37
|
-
@fields << { args.first => Label.new(@browser, args[1..args.length]) }
|
38
|
-
end
|
39
|
-
|
40
|
-
def Image(*args)
|
41
|
-
@fields << { args.first => Image.new(@browser, args[1..args.length]) }
|
42
|
-
end
|
43
|
-
|
44
|
-
def Hyperlink(*args)
|
45
|
-
@fields << { args.first => Hyperlink.new(@browser, args[1..args.length]) }
|
46
|
-
end
|
47
|
-
|
48
|
-
def List(*args)
|
49
|
-
@fields << { args.first => List.new(@browser, args[1..args.length]) }
|
50
|
-
end
|
51
|
-
|
52
|
-
def Date(*args)
|
53
|
-
@fields << { args.first => Date.new(@browser, args[1..args.length]) }
|
54
|
-
end
|
55
|
-
|
56
|
-
def Date(*args)
|
57
|
-
@fields << { args.first => Date.new(@browser, args[1]) }
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module WebAbstractions
|
3
|
+
class Page
|
4
|
+
|
5
|
+
def AlternateUrls
|
6
|
+
[]
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :fields
|
10
|
+
|
11
|
+
def initialize(browser)
|
12
|
+
@browser = browser
|
13
|
+
@fields = []
|
14
|
+
end
|
15
|
+
|
16
|
+
def DropDown(*args)
|
17
|
+
@fields << { args.first => DropDown.new(@browser, args[1..args.length]) }
|
18
|
+
end
|
19
|
+
|
20
|
+
def TextBox(*args)
|
21
|
+
@fields << { args.first => TextBox.new(@browser, args[1..args.length]) }
|
22
|
+
end
|
23
|
+
|
24
|
+
def RadioButton(*args)
|
25
|
+
@fields << { args.first => RadioButton.new(@browser, args[1..args.length]) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def CheckBox(*args)
|
29
|
+
@fields << { args.first => CheckBox.new(@browser, args[1..args.length]) }
|
30
|
+
end
|
31
|
+
|
32
|
+
def Button(*args)
|
33
|
+
@fields << { args.first => Button.new(@browser, args[1..args.length]) }
|
34
|
+
end
|
35
|
+
|
36
|
+
def Label(*args)
|
37
|
+
@fields << { args.first => Label.new(@browser, args[1..args.length]) }
|
38
|
+
end
|
39
|
+
|
40
|
+
def Image(*args)
|
41
|
+
@fields << { args.first => Image.new(@browser, args[1..args.length]) }
|
42
|
+
end
|
43
|
+
|
44
|
+
def Hyperlink(*args)
|
45
|
+
@fields << { args.first => Hyperlink.new(@browser, args[1..args.length]) }
|
46
|
+
end
|
47
|
+
|
48
|
+
def List(*args)
|
49
|
+
@fields << { args.first => List.new(@browser, args[1..args.length]) }
|
50
|
+
end
|
51
|
+
|
52
|
+
def Date(*args)
|
53
|
+
@fields << { args.first => Date.new(@browser, args[1..args.length]) }
|
54
|
+
end
|
55
|
+
|
56
|
+
def Date(*args)
|
57
|
+
@fields << { args.first => Date.new(@browser, args[1]) }
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require File.expand_path('../../WebAbstractions/Controls/Base/Control', File.dirname(__FILE__))
|
2
|
-
|
3
|
-
module Sapphire
|
4
|
-
module WebAbstractions
|
5
|
-
class Button < Control
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
1
|
+
require File.expand_path('../../WebAbstractions/Controls/Base/Control', File.dirname(__FILE__))
|
2
|
+
|
3
|
+
module Sapphire
|
4
|
+
module WebAbstractions
|
5
|
+
class Button < Control
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
@@ -1,28 +1,28 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module WebAbstractions
|
3
|
-
class CheckBox < Control
|
4
|
-
def Check (value)
|
5
|
-
|
6
|
-
if value && self.IsChecked
|
7
|
-
return;
|
8
|
-
end
|
9
|
-
|
10
|
-
if !value && !self.IsChecked
|
11
|
-
return;
|
12
|
-
end
|
13
|
-
|
14
|
-
radio = self.Find
|
15
|
-
radio.click
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
def IsChecked
|
20
|
-
|
21
|
-
radio = self.Find
|
22
|
-
radio.attribute("checked")
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
1
|
+
module Sapphire
|
2
|
+
module WebAbstractions
|
3
|
+
class CheckBox < Control
|
4
|
+
def Check (value)
|
5
|
+
|
6
|
+
if value && self.IsChecked
|
7
|
+
return;
|
8
|
+
end
|
9
|
+
|
10
|
+
if !value && !self.IsChecked
|
11
|
+
return;
|
12
|
+
end
|
13
|
+
|
14
|
+
radio = self.Find
|
15
|
+
radio.click
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
def IsChecked
|
20
|
+
|
21
|
+
radio = self.Find
|
22
|
+
radio.attribute("checked")
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module WebAbstractions
|
3
|
-
class Date < Control
|
4
|
-
|
5
|
-
def Text
|
6
|
-
control = self.Find
|
7
|
-
return DateTime.strptime(control.text, "%m/%d/%Y %H:%M:%S %p").to_date
|
8
|
-
end
|
9
|
-
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module WebAbstractions
|
3
|
+
class Date < Control
|
4
|
+
|
5
|
+
def Text
|
6
|
+
control = self.Find
|
7
|
+
return DateTime.strptime(control.text, "%m/%d/%Y %H:%M:%S %p").to_date
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module WebAbstractions
|
3
|
-
class DropDown < Control
|
4
|
-
def Selected= (value)
|
5
|
-
Set(value)
|
6
|
-
end
|
7
|
-
|
8
|
-
def Selected
|
9
|
-
text = self.Find
|
10
|
-
text.value
|
11
|
-
end
|
12
|
-
|
13
|
-
def Text
|
14
|
-
text = self.Find
|
15
|
-
text.attribute("value")
|
16
|
-
end
|
17
|
-
|
18
|
-
def Set(value)
|
19
|
-
text = self.Find
|
20
|
-
options = text.find_elements(:tag_name, "option")
|
21
|
-
selection = options.find{|o| o.text == value.to_s}
|
22
|
-
raise "could not find the value " + value.to_s if selection.nil?
|
23
|
-
selection.click
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module WebAbstractions
|
3
|
+
class DropDown < Control
|
4
|
+
def Selected= (value)
|
5
|
+
Set(value)
|
6
|
+
end
|
7
|
+
|
8
|
+
def Selected
|
9
|
+
text = self.Find
|
10
|
+
text.value
|
11
|
+
end
|
12
|
+
|
13
|
+
def Text
|
14
|
+
text = self.Find
|
15
|
+
text.attribute("value")
|
16
|
+
end
|
17
|
+
|
18
|
+
def Set(value)
|
19
|
+
text = self.Find
|
20
|
+
options = text.find_elements(:tag_name, "option")
|
21
|
+
selection = options.find{|o| o.text == value.to_s}
|
22
|
+
raise "could not find the value " + value.to_s if selection.nil?
|
23
|
+
selection.click
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
27
|
end
|