selenium_fury 0.5 → 0.5.1
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/CHANGELOG +1 -0
- data/lib/page_generator.rb +14 -2
- data/selenium_fury.gemspec +1 -1
- metadata +3 -2
data/CHANGELOG
CHANGED
data/lib/page_generator.rb
CHANGED
@@ -14,6 +14,19 @@
|
|
14
14
|
# * limitations under the License.
|
15
15
|
# */
|
16
16
|
module PageGenerator
|
17
|
+
def get_name_and_value(html_element)
|
18
|
+
if html_element.get_attribute("id") != nil
|
19
|
+
attribute_name = html_element.get_attribute("id")
|
20
|
+
attribute_value = html_element.get_attribute("id")
|
21
|
+
elsif html_element.get_attribute("name") != nil
|
22
|
+
attribute_name = html_element.get_attribute("name")
|
23
|
+
attribute_value = html_element.get_attribute("name")
|
24
|
+
elsif html_element.get_attribute("title") != nil
|
25
|
+
attribute_name = html_element.get_attribute("title")
|
26
|
+
attribute_value = html_element.get_attribute("title")
|
27
|
+
end
|
28
|
+
return attribute_name, attribute_value
|
29
|
+
end
|
17
30
|
|
18
31
|
def generate_instance_variables_from_html(options)
|
19
32
|
if options.kind_of?(Hash)
|
@@ -25,8 +38,7 @@ module PageGenerator
|
|
25
38
|
html_elements = {}
|
26
39
|
if (@locator_type=="css")
|
27
40
|
doc.css(@locator).each do |html_element|
|
28
|
-
attribute_name =
|
29
|
-
attribute_value = html_element.get_attribute("id")
|
41
|
+
attribute_name, attribute_value = get_name_and_value(html_element)
|
30
42
|
if !attribute_name.nil?
|
31
43
|
attribute_name.gsub!('input-', '')
|
32
44
|
attribute_name.gsub!('select-', '')
|
data/selenium_fury.gemspec
CHANGED
metadata
CHANGED