rautomation 2.0.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.gitignore +41 -0
  4. data/.rspec +2 -0
  5. data/.yardopts +8 -0
  6. data/CHANGES.md +276 -0
  7. data/Gemfile +3 -0
  8. data/LICENSE +20 -0
  9. data/README.md +142 -0
  10. data/Rakefile +73 -0
  11. data/ext/AutoItX/AutoItX.chm +0 -0
  12. data/ext/AutoItX/AutoItX3.dll +0 -0
  13. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.cpp +30 -0
  14. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj +179 -0
  15. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj.filters +42 -0
  16. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj.user +3 -0
  17. data/ext/IAccessibleDLL/IAccessibleDLL/ReadMe.txt +48 -0
  18. data/ext/IAccessibleDLL/IAccessibleDLL/dllmain.cpp +19 -0
  19. data/ext/IAccessibleDLL/IAccessibleDLL/stdafx.cpp +8 -0
  20. data/ext/IAccessibleDLL/IAccessibleDLL/stdafx.h +22 -0
  21. data/ext/IAccessibleDLL/IAccessibleDLL/table_support.cpp +282 -0
  22. data/ext/IAccessibleDLL/IAccessibleDLL/targetver.h +8 -0
  23. data/ext/IAccessibleDLL/IAccessibleDLL.sln +31 -0
  24. data/ext/IAccessibleDLL/IAccessibleDLL.suo +0 -0
  25. data/ext/IAccessibleDLL/Release/IAccessibleDLL.dll +0 -0
  26. data/ext/UiaDll/RAutomation.UIA/Controls/Clicker.cs +63 -0
  27. data/ext/UiaDll/RAutomation.UIA/Controls/SelectList.cs +116 -0
  28. data/ext/UiaDll/RAutomation.UIA/Controls/Spinner.cs +46 -0
  29. data/ext/UiaDll/RAutomation.UIA/Controls/TabControl.cs +54 -0
  30. data/ext/UiaDll/RAutomation.UIA/Controls/TableControl.cs +132 -0
  31. data/ext/UiaDll/RAutomation.UIA/Controls/TextControl.cs +50 -0
  32. data/ext/UiaDll/RAutomation.UIA/Expander.cs +59 -0
  33. data/ext/UiaDll/RAutomation.UIA/Extensions/Element.cs +166 -0
  34. data/ext/UiaDll/RAutomation.UIA/Extensions/Enumerable.cs +76 -0
  35. data/ext/UiaDll/RAutomation.UIA/Extensions/Property.cs +27 -0
  36. data/ext/UiaDll/RAutomation.UIA/Properties/AssemblyInfo.cs +36 -0
  37. data/ext/UiaDll/RAutomation.UIA/Properties/AutomationProperties.cs +18 -0
  38. data/ext/UiaDll/RAutomation.UIA/RAutomation.UIA.csproj +77 -0
  39. data/ext/UiaDll/Release/RAutomation.UIA.dll +0 -0
  40. data/ext/UiaDll/Release/UiaDll.dll +0 -0
  41. data/ext/UiaDll/UiaDll/ArrayHelper.cpp +14 -0
  42. data/ext/UiaDll/UiaDll/ArrayHelper.h +7 -0
  43. data/ext/UiaDll/UiaDll/AssemblyInfo.cpp +40 -0
  44. data/ext/UiaDll/UiaDll/ControlMethods.cpp +16 -0
  45. data/ext/UiaDll/UiaDll/DynamicAssemblyResolver.cpp +24 -0
  46. data/ext/UiaDll/UiaDll/DynamicAssemblyResolver.h +16 -0
  47. data/ext/UiaDll/UiaDll/Locator.cpp +93 -0
  48. data/ext/UiaDll/UiaDll/Locator.h +55 -0
  49. data/ext/UiaDll/UiaDll/MenuItemSelector.cpp +75 -0
  50. data/ext/UiaDll/UiaDll/MenuItemSelector.h +24 -0
  51. data/ext/UiaDll/UiaDll/MenuMethods.cpp +62 -0
  52. data/ext/UiaDll/UiaDll/ReadMe.txt +38 -0
  53. data/ext/UiaDll/UiaDll/SelectListMethods.cpp +84 -0
  54. data/ext/UiaDll/UiaDll/SpinnerMethods.cpp +61 -0
  55. data/ext/UiaDll/UiaDll/StringHelper.cpp +57 -0
  56. data/ext/UiaDll/UiaDll/StringHelper.h +15 -0
  57. data/ext/UiaDll/UiaDll/StringMethods.cpp +8 -0
  58. data/ext/UiaDll/UiaDll/TabControlMethods.cpp +40 -0
  59. data/ext/UiaDll/UiaDll/TableMethods.cpp +108 -0
  60. data/ext/UiaDll/UiaDll/TextMethods.cpp +25 -0
  61. data/ext/UiaDll/UiaDll/ToggleStateHelper.h +10 -0
  62. data/ext/UiaDll/UiaDll/UiaDll.cpp +216 -0
  63. data/ext/UiaDll/UiaDll/UiaDll.h +13 -0
  64. data/ext/UiaDll/UiaDll/UiaDll.vcxproj +167 -0
  65. data/ext/UiaDll/UiaDll/UiaDll.vcxproj.filters +110 -0
  66. data/ext/UiaDll/UiaDll/app.ico +0 -0
  67. data/ext/UiaDll/UiaDll/app.rc +0 -0
  68. data/ext/UiaDll/UiaDll/dllmain.cpp +1 -0
  69. data/ext/UiaDll/UiaDll/resource.h +3 -0
  70. data/ext/UiaDll/UiaDll/stdafx.cpp +5 -0
  71. data/ext/UiaDll/UiaDll/stdafx.h +41 -0
  72. data/ext/UiaDll/UiaDll/targetver.h +8 -0
  73. data/ext/UiaDll/UiaDll.sln +57 -0
  74. data/ext/WindowsForms/.nuget/NuGet.Config +6 -0
  75. data/ext/WindowsForms/.nuget/NuGet.exe +0 -0
  76. data/ext/WindowsForms/.nuget/NuGet.targets +136 -0
  77. data/ext/WindowsForms/Release/FizzWare.NBuilder.dll +0 -0
  78. data/ext/WindowsForms/Release/UIA.Extensions.dll +0 -0
  79. data/ext/WindowsForms/Release/WindowsForms.exe +0 -0
  80. data/ext/WindowsForms/WindowsForms/AboutBox.Designer.cs +168 -0
  81. data/ext/WindowsForms/WindowsForms/AboutBox.cs +103 -0
  82. data/ext/WindowsForms/WindowsForms/AboutBox.resx +123 -0
  83. data/ext/WindowsForms/WindowsForms/DataEntryForm.Designer.cs +218 -0
  84. data/ext/WindowsForms/WindowsForms/DataEntryForm.cs +52 -0
  85. data/ext/WindowsForms/WindowsForms/DataEntryForm.resx +120 -0
  86. data/ext/WindowsForms/WindowsForms/DataGridView.Designer.cs +77 -0
  87. data/ext/WindowsForms/WindowsForms/DataGridView.cs +43 -0
  88. data/ext/WindowsForms/WindowsForms/DataGridView.resx +120 -0
  89. data/ext/WindowsForms/WindowsForms/FizzWare.NBuilder.dll +0 -0
  90. data/ext/WindowsForms/WindowsForms/MainFormWindow.Designer.cs +527 -0
  91. data/ext/WindowsForms/WindowsForms/MainFormWindow.cs +109 -0
  92. data/ext/WindowsForms/WindowsForms/MainFormWindow.resx +126 -0
  93. data/ext/WindowsForms/WindowsForms/PersonForm.Designer.cs +119 -0
  94. data/ext/WindowsForms/WindowsForms/PersonForm.cs +34 -0
  95. data/ext/WindowsForms/WindowsForms/PersonForm.resx +120 -0
  96. data/ext/WindowsForms/WindowsForms/Program.cs +21 -0
  97. data/ext/WindowsForms/WindowsForms/Properties/AssemblyInfo.cs +36 -0
  98. data/ext/WindowsForms/WindowsForms/Properties/Resources.Designer.cs +71 -0
  99. data/ext/WindowsForms/WindowsForms/Properties/Resources.resx +117 -0
  100. data/ext/WindowsForms/WindowsForms/Properties/Settings.Designer.cs +30 -0
  101. data/ext/WindowsForms/WindowsForms/Properties/Settings.settings +7 -0
  102. data/ext/WindowsForms/WindowsForms/SimpleElementsForm.Designer.cs +93 -0
  103. data/ext/WindowsForms/WindowsForms/SimpleElementsForm.cs +19 -0
  104. data/ext/WindowsForms/WindowsForms/SimpleElementsForm.resx +120 -0
  105. data/ext/WindowsForms/WindowsForms/UIA.Extensions.dll +0 -0
  106. data/ext/WindowsForms/WindowsForms/ValueMonthCalendar.cs +28 -0
  107. data/ext/WindowsForms/WindowsForms/WindowsForms.csproj +166 -0
  108. data/ext/WindowsForms/WindowsForms/packages.config +4 -0
  109. data/ext/WindowsForms/WindowsForms.sln +46 -0
  110. data/lib/rautomation/adapter/autoit/button.rb +59 -0
  111. data/lib/rautomation/adapter/autoit/locators.rb +22 -0
  112. data/lib/rautomation/adapter/autoit/mouse.rb +38 -0
  113. data/lib/rautomation/adapter/autoit/text_field.rb +70 -0
  114. data/lib/rautomation/adapter/autoit/window.rb +197 -0
  115. data/lib/rautomation/adapter/autoit.rb +8 -0
  116. data/lib/rautomation/adapter/helper.rb +64 -0
  117. data/lib/rautomation/adapter/ms_uia/button.rb +21 -0
  118. data/lib/rautomation/adapter/ms_uia/button_helper.rb +19 -0
  119. data/lib/rautomation/adapter/ms_uia/checkbox.rb +23 -0
  120. data/lib/rautomation/adapter/ms_uia/constants.rb +111 -0
  121. data/lib/rautomation/adapter/ms_uia/control.rb +134 -0
  122. data/lib/rautomation/adapter/ms_uia/functions.rb +279 -0
  123. data/lib/rautomation/adapter/ms_uia/keys.rb +121 -0
  124. data/lib/rautomation/adapter/ms_uia/keystroke_converter.rb +122 -0
  125. data/lib/rautomation/adapter/ms_uia/label.rb +18 -0
  126. data/lib/rautomation/adapter/ms_uia/list_box.rb +46 -0
  127. data/lib/rautomation/adapter/ms_uia/list_item.rb +22 -0
  128. data/lib/rautomation/adapter/ms_uia/locators.rb +23 -0
  129. data/lib/rautomation/adapter/ms_uia/menu.rb +36 -0
  130. data/lib/rautomation/adapter/ms_uia/radio.rb +23 -0
  131. data/lib/rautomation/adapter/ms_uia/select_list.rb +85 -0
  132. data/lib/rautomation/adapter/ms_uia/spinner.rb +31 -0
  133. data/lib/rautomation/adapter/ms_uia/tab_control.rb +46 -0
  134. data/lib/rautomation/adapter/ms_uia/table.rb +140 -0
  135. data/lib/rautomation/adapter/ms_uia/text_field.rb +39 -0
  136. data/lib/rautomation/adapter/ms_uia/uia_dll.rb +428 -0
  137. data/lib/rautomation/adapter/ms_uia/value_control.rb +21 -0
  138. data/lib/rautomation/adapter/ms_uia/window.rb +289 -0
  139. data/lib/rautomation/adapter/ms_uia.rb +27 -0
  140. data/lib/rautomation/adapter/win_32/button.rb +14 -0
  141. data/lib/rautomation/adapter/win_32/button_helper.rb +24 -0
  142. data/lib/rautomation/adapter/win_32/checkbox.rb +14 -0
  143. data/lib/rautomation/adapter/win_32/constants.rb +73 -0
  144. data/lib/rautomation/adapter/win_32/control.rb +86 -0
  145. data/lib/rautomation/adapter/win_32/functions.rb +336 -0
  146. data/lib/rautomation/adapter/win_32/keys.rb +146 -0
  147. data/lib/rautomation/adapter/win_32/label.rb +10 -0
  148. data/lib/rautomation/adapter/win_32/list_box.rb +40 -0
  149. data/lib/rautomation/adapter/win_32/locators.rb +22 -0
  150. data/lib/rautomation/adapter/win_32/mouse.rb +59 -0
  151. data/lib/rautomation/adapter/win_32/password_field.rb +15 -0
  152. data/lib/rautomation/adapter/win_32/radio.rb +11 -0
  153. data/lib/rautomation/adapter/win_32/select_list.rb +97 -0
  154. data/lib/rautomation/adapter/win_32/table.rb +25 -0
  155. data/lib/rautomation/adapter/win_32/text_field.rb +52 -0
  156. data/lib/rautomation/adapter/win_32/window.rb +277 -0
  157. data/lib/rautomation/adapter/win_32.rb +23 -0
  158. data/lib/rautomation/button.rb +55 -0
  159. data/lib/rautomation/element_collections.rb +55 -0
  160. data/lib/rautomation/platform.rb +15 -0
  161. data/lib/rautomation/text_field.rb +60 -0
  162. data/lib/rautomation/version.rb +3 -0
  163. data/lib/rautomation/wait_helper.rb +23 -0
  164. data/lib/rautomation/window.rb +248 -0
  165. data/lib/rautomation.rb +8 -0
  166. data/rautomation.gemspec +52 -0
  167. data/spec/adapter/autoit/mouse_spec.rb +53 -0
  168. data/spec/adapter/autoit/window_spec.rb +17 -0
  169. data/spec/adapter/ms_uia/button_spec.rb +39 -0
  170. data/spec/adapter/ms_uia/checkbox_spec.rb +55 -0
  171. data/spec/adapter/ms_uia/control_spec.rb +88 -0
  172. data/spec/adapter/ms_uia/functions_spec.rb +39 -0
  173. data/spec/adapter/ms_uia/keystroke_converter_spec.rb +48 -0
  174. data/spec/adapter/ms_uia/label_spec.rb +18 -0
  175. data/spec/adapter/ms_uia/list_item_spec.rb +14 -0
  176. data/spec/adapter/ms_uia/listbox_spec.rb +73 -0
  177. data/spec/adapter/ms_uia/radio_spec.rb +39 -0
  178. data/spec/adapter/ms_uia/select_list_spec.rb +118 -0
  179. data/spec/adapter/ms_uia/spinner_spec.rb +44 -0
  180. data/spec/adapter/ms_uia/tab_control_spec.rb +53 -0
  181. data/spec/adapter/ms_uia/table_spec.rb +197 -0
  182. data/spec/adapter/ms_uia/text_field_spec.rb +43 -0
  183. data/spec/adapter/ms_uia/value_control_spec.rb +11 -0
  184. data/spec/adapter/ms_uia/window_spec.rb +81 -0
  185. data/spec/adapter/win_32/button_spec.rb +31 -0
  186. data/spec/adapter/win_32/checkbox_spec.rb +46 -0
  187. data/spec/adapter/win_32/label_spec.rb +13 -0
  188. data/spec/adapter/win_32/listbox_spec.rb +41 -0
  189. data/spec/adapter/win_32/mouse_spec.rb +49 -0
  190. data/spec/adapter/win_32/radio_spec.rb +33 -0
  191. data/spec/adapter/win_32/select_list_spec.rb +65 -0
  192. data/spec/adapter/win_32/table_spec.rb +27 -0
  193. data/spec/adapter/win_32/text_field_spec.rb +24 -0
  194. data/spec/adapter/win_32/window_spec.rb +61 -0
  195. data/spec/button_spec.rb +67 -0
  196. data/spec/buttons_spec.rb +21 -0
  197. data/spec/spec_helper.rb +128 -0
  198. data/spec/text_field_spec.rb +64 -0
  199. data/spec/text_fields_spec.rb +22 -0
  200. data/spec/window_spec.rb +150 -0
  201. data/spec/windows_spec.rb +76 -0
  202. metadata +369 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d8c326b3fdb48e487d3729957fb28e521a7d5d7e4390e1217937f5fc121fa95c
4
+ data.tar.gz: 678161c7a4adf3cb6d729ffa939f4d98044f9a3c9aba742937e9446f99b8fef6
5
+ SHA512:
6
+ metadata.gz: 97ee462a55acfb4732813f47cca9b0132648ac1a4874973724cbe7f6d296d39e53567399c72323cf07497264417e68f05a1d74467f2722610846c8be23f13544
7
+ data.tar.gz: b6b54d63b44484daafc090ff99baf1bcbc90e9b0e5e4aee9c344d323dfa7f9436f0a96c34b762547590630fb6051a1962c68ff9575ae7d944d01fe51186c975d
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.md
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,41 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ /coverage
18
+ /rdoc
19
+ /pkg
20
+ /ext/IAccessibleDLL/x64Release/
21
+ /ext/IAccessibleDLL/x86Release/
22
+ /ext/UiaDll/x64Release/
23
+ /ext/UiaDll/x86Release/
24
+
25
+ ## PROJECT::SPECIFIC
26
+ /.idea/*
27
+
28
+ /.yardoc/
29
+ /doc/
30
+
31
+ ## VisualStudio
32
+ Debug
33
+ Release
34
+ ipch
35
+ *.sdf
36
+ *.suo
37
+ *.user
38
+ *.opensdf
39
+ _ReSharper*/
40
+ packages/
41
+ .vs/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/.yardopts ADDED
@@ -0,0 +1,8 @@
1
+ --readme README.md
2
+ --no-private
3
+ --hide-void-return
4
+ --title "RAutomation"
5
+ --files CHANGES.md,LICENSE
6
+ --default-return ""
7
+ --markup-provider redcarpet
8
+ --markup markdown
data/CHANGES.md ADDED
@@ -0,0 +1,276 @@
1
+ ## 2.0.1 / 2023-03-25
2
+
3
+ * Gem platform attribute value change.
4
+
5
+ ## 2.0.0 / 2023-03-25
6
+
7
+ * Add support for 64bit Ruby for the Win32 adapter. PR #136
8
+
9
+ ## 1.1.0 / 2021-12-03
10
+
11
+ * Update ffi dependency to ~> 1.15.0. PR #132
12
+
13
+ ## 1.0.0 / 2019-12-11
14
+
15
+ * Update ffi dependency to ~> 1.11.0.
16
+ * Use Visual Studio 2019 Build Tools for running tests.
17
+
18
+ ## 0.17.0 / 2014-09-29
19
+
20
+ ### Win32 adapter
21
+
22
+ * Fix searching locators by hwnd. See more at issue #96.
23
+
24
+ ## 0.16.0 / 2014-09-29
25
+
26
+ * Loosen up ffi dependency due to fixed segfault problem. See more at issue #81.
27
+
28
+ ## 0.15.0 / 2014-06-01
29
+
30
+ * Fixes #send_keys with special characters. Issue #92.
31
+
32
+ ## 0.14.1 / 2014-02-05
33
+
34
+ * Set ffi 1.9.0 as a dependency for now because newer versions are broken. See more at issue #81.
35
+
36
+ ## 0.14.0 / 2014-02-05
37
+
38
+ ### MsUia adapter
39
+
40
+ * Add SelectList#select and SelectList#clear.
41
+ * Add Table#select and Table#clear.
42
+ * Add Table#selected_rows.
43
+ * Improve performance of table Row lookups.
44
+ * SelectList#options accepts :index and :text (Regexp or String).
45
+ * Window#child in ms_uia works for popup windows as well.
46
+
47
+ ## 0.13.0
48
+
49
+ ### MsUia adapter
50
+
51
+ * Added #select and #clear into SelectList::SelectListOption for multi-select support
52
+ * Removed SelectList#select and SelectList#set
53
+ * Added #select, #selected? and #clear to Table::Row for multi-select support
54
+ * Removed Table#select and Table#selected?
55
+ * Fixed an issue with selecting ListBox items that our outside of the viewable area
56
+
57
+ ## 0.12.0 / 2013-09-05
58
+
59
+ ### MsUia adapter
60
+
61
+ * Add Control#help_text to relay ToolTip information
62
+
63
+ ## 0.11.0 / 2013-08-10
64
+
65
+ ### MsUia adapter
66
+
67
+ * Add support for Window#spinner
68
+
69
+ ## 0.10.0 / 2013-07-26
70
+
71
+ ### MsUia adapter
72
+
73
+ * Fixed an issue with trying to interact with a button after it goes away
74
+ * Add support for Window#tab_control
75
+
76
+ ## 0.9.4 / 2013-07-23
77
+
78
+ * Add license part of gemspec. Closes #70.
79
+
80
+ ## 0.9.3 / 2013-07-23
81
+
82
+ ### MsUia adapter
83
+
84
+ * Added the ability to limit the scope to children only when looking for a control
85
+ * Fixed issues with ListBox controls not firing index change events
86
+
87
+ ## 0.9.2 / 2013-05-19
88
+
89
+ ### Win32 adapter
90
+
91
+ * Window#send_keys supports now :dash, :slash and :backslash. Closes #64.
92
+
93
+ ### MsUia adapter
94
+
95
+ * Ability to get and set the text of a multi-line text control that only supports the TextPattern.
96
+ * Add some caching to speed up locating controls.
97
+ * Fix issue #67 that happens when clicking on controls.
98
+
99
+ ### AutoIt adapter
100
+
101
+ * Add deprecation warning.
102
+
103
+ ## 0.9.1 / 2013-04-26
104
+
105
+ ### MsUia adapter
106
+
107
+ * Ability to interact with controls that do not have native window handles (for example WPF applications).
108
+
109
+ ## 0.9.0 / 2013-04-22
110
+
111
+ ### MsUia adapter
112
+
113
+ * Add support for :name locator.
114
+ * Add support for Window#value_control.
115
+ * Add Table#headers.
116
+ * Add Table#values.
117
+ * Control#exists? uses now uia code.
118
+ * ControlType.Document is also considered as a TextField.
119
+ * Table#select and Table#selected? use 0-based indexing.
120
+ * Table#select supports value too.
121
+
122
+ ### Win32 adapter
123
+
124
+ * Add support for "[", "]" and "'" characters when using Window#send_keys. Fixes #61.
125
+
126
+ ## 0.8.0 / 2012-12-26
127
+
128
+ ### MsUia adapter
129
+
130
+ * Add Control#collapse for collapsing values in collapsable items.
131
+ * Add Control#expand for expanding values in expandable items.
132
+ * Add Row#cell(s).
133
+ * Add Table#cell(s).
134
+ * Add Table#row(s).
135
+ * Add Window#menu for selecting menu items.
136
+ * Fire change events when SelectList selections have been changed.
137
+ * Window#child instantiates MsUia adapter Window.
138
+
139
+ ## 0.7.3 / 2012-10-31
140
+
141
+ ### Win32 adapter
142
+
143
+ * Add support for PasswordField.
144
+
145
+ ### AutoIt adapter
146
+
147
+ * Show error message when registration of AutoIt dll fails.
148
+
149
+ ## 0.7.2 / 2012-03-18
150
+
151
+ ### Win32 adapter
152
+
153
+ * add mouse API with Window#mouse method
154
+ * add Mouse#move, #position, #click, #press and #release methods
155
+
156
+ ### AutoIt adapter
157
+
158
+ * support the same mouse API as Win32 adapter
159
+
160
+ ## 0.7.1 / 2012-02-26
161
+
162
+ ### Win32 adapter
163
+
164
+ * add Window#dimensions to get coordinates of the window
165
+ * add Window#move to move/resize the window
166
+ * fix Window#child not to raise any exceptions for cases where window isn't technically a child
167
+
168
+ ## Version 0.7.0 / 2012-02-23
169
+
170
+ ### All adapters
171
+
172
+ * renamed WinFfi adapter to Win32 adapter
173
+ * added experimental MsUia adapter
174
+ * added support for JRuby
175
+ * Window.windows accepts locators too
176
+ * added Window#class_names for retrieving internal class names of the window and it's controls
177
+ * default locator is :index => 0 when nothing else specified
178
+
179
+ ### Win32 adapter
180
+
181
+ * Window#send_keys has now syntax similar to WatirSpec (https://github.com/watir/watirspec/blob/master/element_spec.rb#L206-249)
182
+ * added TextField#send_keys
183
+
184
+ ### AutoIt adapter
185
+
186
+ * added Window#mouse_move, #mouse_click, #mouse_position, #press_mouse and #release_mouse methods for AutoIt adapter
187
+
188
+ ## Version 0.6.3 / 2011-07-16
189
+
190
+ * use current window's handle (hwnd) in WinFfi::Window#child method
191
+
192
+ ## Version 0.6.2 / 2011-07-07
193
+
194
+ ### WinFFI adapter
195
+
196
+ * loading lazily oleacc.dll
197
+ * loading lazily uia_dll.rb due to problems on certain Windows XP machines
198
+
199
+ ## Version 0.6.1 / 2011-07-05
200
+
201
+ ### WinFFI adapter
202
+
203
+ * Fixed it for Ruby 1.9.2.
204
+
205
+ ## Version 0.6.0 / 2011-07-03
206
+
207
+ ### WinFFI adapter
208
+
209
+ * Window#send_keys now accepts only String argument similar to AutoIt's Send function.
210
+ * added Table#strings, #select, #selected? methods.
211
+ * added Label element support with #value method.
212
+ * added #has_focus? and #set_focus methods to controls.
213
+ * added possibility to search controls by automation id as :id.
214
+ * added #enabled? and #disabled? methods for controls.
215
+ * added Window#control and #controls methods for accessing controls generally.
216
+ * added SelectList#option method.
217
+ * added ListBox element support with #count, #items, #exist?, #selected? and #select methods.
218
+
219
+ ## Version 0.5.1 / 2011-01-30
220
+
221
+ ### All adapters
222
+
223
+ * added Window.windows, #windows, #buttons and #text_fields methods to retrieve collection of elements and use them with Enumerable/Array methods.
224
+
225
+ ### WinFFI adapter
226
+
227
+ * added Window#child method for searching child windows and popups
228
+ * added initial support for Radio, Checkbox, SelectList and Table
229
+
230
+ ### AutoIt adapter
231
+
232
+ * allow to search windows by PID
233
+
234
+ ## Version 0.4.0 / 2010-12-23
235
+
236
+ * allow to search windows without text (like empty Notepad window for example).
237
+ * added possibility to use block for #click to specify successful clicking condition.
238
+ * renamed :ffi adapter to :win_ffi because FFI may be used on other platforms too.
239
+
240
+ ## Version 0.3.0 / 2010-12-18
241
+
242
+ * added Ffi adapter specific method Window#child which searches for child windows and popups
243
+
244
+ ## Version 0.2.1 / 2010-12-17
245
+
246
+ * added yard options for documentation
247
+
248
+ ## Version 0.2.0 / 2010-12-17
249
+
250
+ * added Window#pid method
251
+
252
+ ## Version 0.1.0 / 2010-12-14
253
+
254
+ * added new default adapter for Windows: FFI
255
+ * changes for AutoIt adapter:
256
+ - added 0-based :index locator for window locators to search for windows with the same criteria.
257
+ - renamed text_field and button locator :instance to :index instead.
258
+ - :class_name locator is not allowed anymore. Use :class and :index together instead.
259
+ - use :value for button locator instead of :text
260
+
261
+ ## Version 0.0.4 / 2010-10-27
262
+
263
+ * most Window, Button and TextField methods wait until the object exists. Use RAutomation::Window.wait_timeout= to set timeout before failing. Default is 60 seconds.
264
+
265
+ ## Version 0.0.3 / 2010-10-15
266
+
267
+ * RAutomation didn't load AutoIt correctly if it wasn't installed before
268
+
269
+ ## Version 0.0.2 / 2010-10-14
270
+
271
+ * using :value locator for buttons instead of :text
272
+ * searching only visible windows with some text on them
273
+
274
+ ## Version 0.0.1 / 2010-10-13
275
+
276
+ * Initial release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) Jarmo Pertman
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # RAutomation
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/rautomation.png)](http://badge.fury.io/rb/rautomation)
4
+
5
+ * Web: http://www.github.com/jarmo/RAutomation
6
+ * Author: Jarmo Pertman [jarmo@jarmopertman.com](mailto:jarmo@jarmopertman.com)
7
+
8
+
9
+ RAutomation is a small and easy to use library for helping out to automate
10
+ windows and their controls for automated testing.
11
+
12
+ RAutomation provides:
13
+ * Easy to use and user-friendly API (inspired by [Watir](http://www.watir.com))
14
+ * Cross-platform compatibility
15
+ * Easy extensibility - with small scripting effort it's possible to add
16
+ support for not yet supported platforms or technologies
17
+
18
+
19
+ ## USAGE
20
+
21
+ require "rautomation"
22
+
23
+ window = RAutomation::Window.new(:title => /part of the title/i)
24
+ window.exists? # => true
25
+
26
+ window.title # => "blah blah part Of the title blah"
27
+ window.text # => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ultricies..."
28
+
29
+ window.text_field(:class => "Edit", :index => 0).set "hello, world!"
30
+ button = window.button(:value => "&Save")
31
+ button.exists? # => true
32
+ button.click
33
+
34
+ all_windows = RAutomation::Window.windows
35
+ all_windows.each {|window| puts window.hwnd}
36
+
37
+ window = RAutomation::Window.new(:title => /part of the title/i)
38
+ windows = window.windows
39
+ puts windows.size # => 2
40
+ windows.map &:title # => ["part of the title 1", "part of the title 2"]
41
+
42
+ window.windows(:title => /part of other title/i) # => all windows with matching specified title
43
+
44
+ window.buttons.each {|button| puts button.value}
45
+ window.buttons(:value => /some value/i).each {|button| puts button.value}
46
+
47
+ window2 = RAutomation::Window.new(:title => "Other Title", :adapter => :autoit) # use AutoIt adapter
48
+ # use adapter's (in this case AutoIt's) internal methods not part of the public API directly
49
+ window2.WinClose("[TITLE:Other Title]")
50
+
51
+ Check out [the documentation](https://rubydoc.info/github/jarmo/RAutomation) for other possible usages!
52
+
53
+ ## INSTALL
54
+
55
+ ### Windows
56
+
57
+ gem install rautomation
58
+
59
+ Available adapters:
60
+ * :win_32 - uses Windows API directly with FFI (default)
61
+ * :ms_uia - an experimental adapter
62
+ * :autoit - uses AutoIt for automation (DEPRECATED)
63
+
64
+
65
+ When using AutoIt adapter: You might need administrative privileges if running
66
+ for the first time and you haven't installed AutoIt before!
67
+
68
+ ### Linux
69
+
70
+ Feel yourself at home on Linux and know how to automate windows and their
71
+ controls? I would be happy if you'd contact me about that matter - or even
72
+ better, follow the instructions at "How to create a new adapter?"
73
+
74
+ ### OS X
75
+
76
+ Feel yourself at home on OS X and know how to automate windows and their
77
+ controls? I would be happy if you'd contact me about that matter - or even
78
+ better, follow the instructions at "How to create a new adapter?"
79
+
80
+ ### Others
81
+
82
+ Feel yourself at home on some operating system not listed in here and know how
83
+ to automate windows and their controls? Does Ruby also work on that operating
84
+ system? I would be happy if you'd contact me about that matter - or even
85
+ better, follow the instructions at "How to create a new adapter?"
86
+
87
+ ## Supported Ruby Platforms
88
+
89
+ 64bit Ruby platform is **only supported for Win32 adapter**.
90
+ Other adapters can be used only on a 32bit Ruby!
91
+
92
+ ## How to create a new adapter?
93
+
94
+ 1. Fork the project.
95
+ 2. Create entry point file to lib/rautomation/adapter which should load all
96
+ adapter specific files.
97
+ 3. Add `autoload` statement into lib/rautomation/adapter/helper.rb for that
98
+ file.
99
+ 4. Create a directory for your adapter's specific code into
100
+ lib/rautomation/adapter
101
+ 5. Copy button.rb, text_field.rb and window.rb from some of the existing
102
+ adapter's directory.
103
+ 6. Add spec data for your adapter into spec/spec_helper DATA constant.
104
+ 7. Use environment variable *RAUTOMATION_ADAPTER* to point to that adapter.
105
+ 8. Start coding and spec-ing until as much of possible of the public API is
106
+ satisfied.
107
+ 9. Make me a pull request.
108
+
109
+
110
+ Don't forget to fix the documentation for that adapter also!
111
+
112
+ In case of any problems, feel free to contact me.
113
+
114
+ ## Contributors
115
+
116
+ * Levi Wilson - https://github.com/leviwilson
117
+ * Eric Kessler - https://github.com/enkessler
118
+ * Stephan Schwab - https://github.com/snscaimito
119
+
120
+
121
+ ## Libraries Using RAutomation
122
+
123
+ * [watir-classic](https://github.com/watir/watir-classic)
124
+ * [mohawk](https://github.com/leviwilson/mohawk)
125
+
126
+
127
+ ## Note on Patches/Pull Requests
128
+
129
+ * Fork the project.
130
+ * Make your feature addition or bug fix.
131
+ * Add tests for it. This is important so I don't break it in a future
132
+ version unintentionally.
133
+ * Commit, do not mess with rakefile, version, or history.
134
+
135
+ (if you want to have your own version, that is fine but bump version in a
136
+ commit by itself I can ignore when I pull)
137
+ * Send me a pull request. Bonus points for topic branches.
138
+
139
+
140
+ ## Copyright
141
+
142
+ Copyright (c) Jarmo Pertman. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,73 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'rspec/core/rake_task'
4
+
5
+ Bundler::GemHelper.install_tasks
6
+
7
+ def ext_dependencies(name)
8
+ FileList["ext/#{name}/**/*"].reject { |file| file =~ /(Release|Debug)/ }
9
+ end
10
+
11
+ def ms_build(name)
12
+ name = File.basename(name, File.extname(name))
13
+ cmd = "msbuild /p:Configuration=Release ext\\#{name}\\#{name}.sln"
14
+ cmd += " && #{cmd} /p:Platform=x64" unless name == 'WindowsForms'
15
+ sh(cmd)
16
+ end
17
+
18
+ namespace :build do
19
+ build_tasks = [
20
+ {:name => :uia_dll, :path => "UiaDll", :ext => "dll"},
21
+ {:name => :i_accessible_dll, :path => "IAccessibleDLL", :ext => "dll"},
22
+ {:name => :windows_forms, :path => "WindowsForms", :ext => "exe"}
23
+ ]
24
+
25
+ build_tasks.each do |build_task|
26
+ full_ext_path = "ext/#{build_task[:path]}/Release/#{build_task[:path]}.#{build_task[:ext]}"
27
+
28
+ %w[x86Release x64Release].each do |output_dir|
29
+ full_ext_path = full_ext_path.gsub(/(?<!x86|x64)Release/, output_dir) unless build_task[:name] == :windows_forms
30
+
31
+ file full_ext_path => ext_dependencies(build_task[:path]) do |t|
32
+ ms_build(t.name)
33
+ end
34
+ end
35
+
36
+ desc "Build #{build_task[:path]}"
37
+ task build_task[:name] => full_ext_path
38
+ end
39
+
40
+ desc "Build all external dependencies"
41
+ task :all => build_tasks.map { |t| "build:#{t[:name]}"}
42
+ end
43
+
44
+ task :build => "build:all"
45
+
46
+ namespace :spec do
47
+ adapters = %w[win_32]
48
+ adapters << "ms_uia" if Platform.is_x86?
49
+
50
+ adapters.each do |adapter|
51
+ desc "Run RSpec code examples against #{adapter} adapter"
52
+ RSpec::Core::RakeTask.new(adapter) do |_task|
53
+ ENV["RAUTOMATION_ADAPTER"] = adapter
54
+ puts "Running specs for adapter: #{adapter}"
55
+ end
56
+ end
57
+
58
+ desc "Run RSpec code examples against all adapters"
59
+ task :all => adapters.map {|a| "spec:#{a}"}
60
+ end
61
+
62
+ task :spec => "spec:all"
63
+
64
+ RSpec::Core::RakeTask.new(:rcov) { |spec| spec.rcov = true }
65
+
66
+ require 'yard'
67
+ YARD::Rake::YardocTask.new
68
+
69
+ task :default => "spec:all"
70
+
71
+ task "release:source_control_push" => :spec
72
+
73
+ task :install => :build
Binary file
Binary file
@@ -0,0 +1,30 @@
1
+ // IAccessibleDLL.cpp : Defines the exported functions for the DLL application.
2
+ //
3
+
4
+ #include "stdafx.h"
5
+
6
+ extern "C"
7
+ __declspec( dllexport ) long get_button_state(HWND buttonHwnd) {
8
+ IAccessible *pIAccessible ;
9
+ VARIANT varState;
10
+ VARIANT varChildId;
11
+ BOOL checked = FALSE ;
12
+ HRESULT hr ;
13
+ HMODULE hModule ;
14
+ LPFNACCESSIBLEOBJECTFROMWINDOW lpfnAccessibleObjectFromWindow ;
15
+
16
+ hModule = LoadLibraryA("oleacc.dll");
17
+ lpfnAccessibleObjectFromWindow = (LPFNACCESSIBLEOBJECTFROMWINDOW)GetProcAddress(hModule, "AccessibleObjectFromWindow");
18
+
19
+ hr = lpfnAccessibleObjectFromWindow(buttonHwnd, OBJID_CLIENT, IID_IAccessible, (void**)&pIAccessible) ;
20
+
21
+ VariantInit(&varChildId);
22
+ varChildId.vt = VT_I4;
23
+ varChildId.lVal = CHILDID_SELF ;
24
+
25
+ pIAccessible->get_accState(varChildId, &varState);
26
+
27
+ return varState.lVal ;
28
+ }
29
+
30
+