lib/selenium/webdriver/ie/bridge.rb in selenium-webdriver-0.0.27 vs lib/selenium/webdriver/ie/bridge.rb in selenium-webdriver-0.0.28
- old
+ new
@@ -348,18 +348,21 @@
"unable to get attribute #{name.inspect}"
end
end
def getElementValue(element_pointer)
- getElementAttribute(element_pointer, 'value').gsub("\r\n", "\n")
+ val = getElementAttribute(element_pointer, 'value')
+ val.gsub("\r\n", "\n") if val
end
def getElementText(element_pointer)
- create_string do |string_pointer|
+ val = create_string do |string_pointer|
check_error_code Lib.wdeGetText(element_pointer, string_pointer),
"unable to get text"
- end.gsub("\r\n", "\n")
+ end
+
+ val.gsub("\r\n", "\n") if val
end
def sendKeysToElement(element_pointer, string)
check_error_code Lib.wdeSendKeys(element_pointer, wstring_ptr(string)),
"unable to send keys to #{self}"
@@ -430,9 +433,13 @@
end
end
def hoverOverElement(element_pointer)
raise NotImplementedError
+ end
+
+ def elementEquals(element, other)
+ executeScript "return arguments[0] === arguments[1]", element, other
end
def dragElement(element_pointer, right_by, down_by)
# TODO: check return values?
hwnd = FFI::MemoryPointer.new :pointer
\ No newline at end of file