Permalink
Browse files

add Element#focused?

  • Loading branch information...
1 parent a449d30 commit 33275ab7ee4182e199a35b623fa118bc5bbad283 @jarmo jarmo committed Jan 28, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 watir/lib/watir/element.rb
@@ -451,6 +451,12 @@ def focus
ole_object.focus
end
+ def focused?
+ assert_exists
+ assert_enabled
+ @page_container.document.activeElement.uniqueNumber == unique_number
+ end
+
# Returns whether this element actually exists.
def exists?
begin

0 comments on commit 33275ab

Please sign in to comment.