gridium 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59ff1c8db4e4f1608e19845e677c545505ec7f09
4
- data.tar.gz: cc3ca13c86beb67307017f57717447fcf57150a4
3
+ metadata.gz: eefb67c054454fc770901e82fc48562a69983c0f
4
+ data.tar.gz: 691a38ba1a6927f33596de5739512a1a64e9d281
5
5
  SHA512:
6
- metadata.gz: 3647c211f68868e9387748bda3cb36a9bc8f86ec5904c10bf6c90566043803348a59edc2cfbeb6c5bc64eb4287b83821d66a607c6ccf1ec3088bf97e669bbc65
7
- data.tar.gz: e60364ac1b398871f8c76dbe0cc956c09415d2002a0ce2b61919ccafa12af4b2f7d92e44bcd3983c594f05bd104a645362c794114c80558162b936b4287be083
6
+ metadata.gz: 46f188677f67d98523ccd4b771e60fc3b8abc6f0a0d7697b50e04e6f3cbead6590504e30af15ce9b8ec22d3829d43463301815942db26186b8ab52740aded3cd
7
+ data.tar.gz: 874e0ccf750bc76e3e562f8e9a9339b7d186b7ff15455fbf427fa364e7f166ab4fbd0cd9a6d28a6dd694c720f3c8493208af467556a1fc37d8d7ebbf076801f4
data/lib/element.rb CHANGED
@@ -39,13 +39,20 @@ class Element
39
39
 
40
40
  def displayed_element
41
41
  found_element = nil
42
- elements = @driver.find_elements(@by, @locator)
43
- ##there's a chance here the element is found but not displayed.
44
- elements.each do |element|
45
- if element.displayed? and element.enabled?
46
- found_element = element;
42
+ #Found an issue where the element would go stale after it's found
43
+ begin
44
+ elements = @driver.find_elements(@by, @locator)
45
+ ##there's a chance here the element is found but not displayed.
46
+ elements.each do |element|
47
+ if element.displayed? and element.enabled?
48
+ found_element = element;
49
+ end
47
50
  end
51
+ rescue Exception => e
52
+ Log.warn("A Crusty old element was detected.... #{self.to_s}")
53
+ retry
48
54
  end
55
+
49
56
  return found_element
50
57
  end
51
58
 
@@ -247,6 +254,7 @@ class Element
247
254
  return false
248
255
  end
249
256
  rescue Exception => e
257
+ Log.warn("Stale element detected.... #{self.to_s}")
250
258
  return true
251
259
  end
252
260
  end
@@ -1,3 +1,3 @@
1
1
  module Gridium
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/page.rb CHANGED
@@ -96,8 +96,9 @@ module Gridium
96
96
  end
97
97
 
98
98
  def click_link(linktext)
99
- link = Driver.driver.find_element(:link, linktext)
99
+ link = Element.new("Clicking #{linktext} Link", :link_text, linktext)
100
100
  link.click
101
+
101
102
  end
102
103
 
103
104
  def click_button(button_name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gridium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Urban
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-22 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler