A
Anukul Singhal
Hi,
I am using AutoIt in my ruby code to automate a client
application.Although most of the AutoIt methods are working fine, I am
not able to use the HWnd function of AutoIt, getting a method missing
error. Would like to know if there is anything wrong in the code below:
require 'win32ole'
autoIt = WIN32OLE.new("AutoItX3.Control")
bb = IO.popen("C:/Windows/Notepad.exe")
sleep 3.0
appID = autoIt.WinGetHandle("Untitled -Notepad")
sAppID = appID.to_s
appHandle = autoIt.HWnd(sAppID)
puts appHandle
The above piece of code gives me this error:
1) Error:
test_client_actions_click_positive(Client_unit_test):
WIN32OLERuntimeError: unknown property or method `HWnd'
HRESULT error code:0x80020006
Unknown name.
Although HWnd is a supported method for AutoIt, I am getting this error.
I know I can use the title arg for performing my actions, but my
requirement is to get the WindowHandle and use it to perform actions
like ControlSetText and ControlClick, etc.
Can anyone tell what is wrong in the above code snippet? Or am I missing
something to make it work.
Thanks,
Anukul
I am using AutoIt in my ruby code to automate a client
application.Although most of the AutoIt methods are working fine, I am
not able to use the HWnd function of AutoIt, getting a method missing
error. Would like to know if there is anything wrong in the code below:
require 'win32ole'
autoIt = WIN32OLE.new("AutoItX3.Control")
bb = IO.popen("C:/Windows/Notepad.exe")
sleep 3.0
appID = autoIt.WinGetHandle("Untitled -Notepad")
sAppID = appID.to_s
appHandle = autoIt.HWnd(sAppID)
puts appHandle
The above piece of code gives me this error:
1) Error:
test_client_actions_click_positive(Client_unit_test):
WIN32OLERuntimeError: unknown property or method `HWnd'
HRESULT error code:0x80020006
Unknown name.
Although HWnd is a supported method for AutoIt, I am getting this error.
I know I can use the title arg for performing my actions, but my
requirement is to get the WindowHandle and use it to perform actions
like ControlSetText and ControlClick, etc.
Can anyone tell what is wrong in the above code snippet? Or am I missing
something to make it work.
Thanks,
Anukul