watir-webdriver 0.0.1 → 0.0.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -146,7 +146,8 @@ module Watir
146
146
  end
147
147
 
148
148
  e.select unless e.selected?
149
- e.text
149
+
150
+ safe_text(e)
150
151
  end
151
152
  end
152
153
 
@@ -175,7 +176,8 @@ module Watir
175
176
  end
176
177
 
177
178
  element.select unless element.selected?
178
- element.text
179
+
180
+ safe_text(element)
179
181
  end
180
182
  end
181
183
 
@@ -201,5 +203,13 @@ module Watir
201
203
  end
202
204
  end
203
205
 
206
+ def safe_text(element)
207
+ element.text
208
+ rescue Selenium::WebDriver::Error::ObsoleteElementError
209
+ # guard for scenario where selecting the element changes the page, making our element obsolete
210
+
211
+ ''
212
+ end
213
+
204
214
  end # SelectList
205
215
  end # Watir
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watir-webdriver
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jari Bakken