there is a method ie.show_active
that might do what you need
Paul
----- Original Message -----
From: Charley Baker
To: [email protected]
Sent: Thursday, March 08, 2007 8:53 AM
Subject: Re: [Wtr-general] Identifying the id of the element with focus after
a tab
Hi Mike,
When you're using AutoIt, you're working with windows controls, not html
elements per se. There's no way that I'm aware of that you can easily get the
html element id using AutoIt. It recognizes windows, controls and identifies
them by using Window handles, text and the like. There's some code in watir.rb
that uses window handles to access JSButtons with WinClicker.
-Charley
On 3/8/07, Mike Ramsey <[EMAIL PROTECTED] > wrote:
I am fairly new to watir so please bear with me. I am using AutoIt to send
{TAB} commands to IE from watir.
class WindowHelper
#Begin stuff Ramsey added
def push_key(winTitleText,keyStroke)
wait_for_window(winTitleText)
if keyStroke != "" and keyStroke != " "
keyStroke = "{" + keyStroke + "}"
#puts "keyStroke = #{keyStroke}"
@autoit.Send keyStroke
#puts "keyStroke sent"
end
widgetId = @autoit.ControlGetFocus winTitleText, ""
puts "ControlRef# = #{widgetId}"
end
def wait_for_window(winTitleText)
unless @autoit.WinWait winTitleText, "", 7
raise ("Timed out waiting for window #{winTitleText}")
end
end
#End stuff Ramsey added
ooo
How can I verify the id of the widget that I tabbed too?
I tried using the AutoIt ControlGetFocus function but it returned a generic
string identical for several widgets in a row (they were hyperlinks).
On a related question, can someone point me to an example script where
control was passed back and forth between AutoIt and watir? That is, a script
that shows how I could get the HTML element id from an autoit instance so that
I could then use that id with an ie instance. Does this make sense?
--Thanks,
--Mike Ramsey
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
------------------------------------------------------------------------------
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general