"No Keyword found" error in AutoIt library

2,110 views
Skip to first unread message

Ganesh Kumbhar

unread,
Dec 16, 2015, 4:51:21 AM12/16/15
to robotframework-users
Hello Every One,

I am new to AutoIt Library and have started with it recently.
I installed it and everything it needs.

So I can run some of the AutoIt keyword like Get Version and Get Auto It Version through test suit.
But For most of the keywords like Mouse Get Cursor,Mouse Get Pos X, Init, Is Admin,Auto It Set Option etc It's Keyword Not Found Error 

Some of the errors are as shown below :

20151216 15:13:39.127 - INFO - +--- START KW: Mouse Click [ strButton=LEFT, nX=-2147483647, nY=-2147483647, nClicks=1, nSpeed=-1 ]
20151216 15:13:39.127 - FAIL - No keyword with name 'Mouse Click' found.

20151216 15:15:56.771 - INFO - +--- START KW: Is Admin [ ]
20151216 15:15:56.772 - FAIL - No keyword with name 'Is Admin' found.

20151216 15:16:38.169 - INFO - +--- START KW: ${GetCursr} = Mouse Get Cursor [ ]
20151216 15:16:38.169 - FAIL - No keyword with name 'Mouse Get Cursor' found.

Kindly suggest me what's wrong here, some keyword are working and some are not :( 
Is there something that I am missing ? 

I installed it be running setup.py from the AutoIt ZIP with admin rights.

Thanks in Advance ,
Ganesh :) 

Mark Winspear

unread,
Dec 16, 2015, 5:01:59 AM12/16/15
to robotframework-users
Hi Ganesh
You'll need to share your code in order for anyone to help with this I would suspect

Ganesh Kumbhar

unread,
Dec 16, 2015, 7:58:58 AM12/16/15
to robotframework-users

Hello Mark,

Thanks for your reply.
Yeah sure, I will share 

I am new to this library so just learning how to run the AutoIt keywords.
So Below is my simple Test case : 

*** Settings ***
Library  OperatingSystem
Library  BuiltIn
Library  AutoItLibrary

*** Variables ***

${Calculator}  C:\\Windows\\system32\\calc.exe

*** Keywords ***
   
TestAuotIt
${Version}  Get Version
Log To Console  \n ${Version}

${Version}  Get Auto It Version
Log To Console  \n ${Version}

AutoItLibrary.Run  ${Calculator}   
        ${X-Pos}  Mouse Get Pos X
${Y-Pos}  Mouse Get Pos Y 
Mouse Click  strButton=LEFT, nX=${X-Pos}, nY=${Y-Pos} , nClicks=2, nSpeed=-1


Here, I want to know how to use keywords and how they works. So I am trying different keywords.

So here in above script, Get Version, Get Auto It Version, Run these keywords are working 
but other keywords i.e. Mouse Click, Mouse Get Pos X etc are not working, Giving keyword not found error.

So How come It's recognising some keywords and not others ? 


Thanks & Regards,
Ganesh

Ganesh Kumbhar

unread,
Dec 16, 2015, 8:21:48 AM12/16/15
to robotframework-users
Am I missing something ?

Mark Winspear

unread,
Dec 16, 2015, 10:38:38 AM12/16/15
to robotframework-users
The keyword documentation for autoit is poor and your usage looks ok except for multi-argument keyword such as:

Mouse Click  strButton=LEFT, nX=${X-Pos}, nY=${Y-Pos} , nClicks=2, nSpeed=-1
remove the commas and ensure two spaces are present between arguments

The keyword library does contain the following advice - have you done this?
"the keywords whose documentation is simply method <KeywordName>(e.g. "method ControlClick") are the native AutoIt keywords.  The detailed documentation for these keywords is available in the AutoItX documentation file: AutoItX.chm.  This file is installed as part of the installation of AutoItLibrary as:

C:\RobotFramework\Extensions\AutoItLibrary\AutoItX.chm"

Kevin O.

unread,
Dec 16, 2015, 12:29:51 PM12/16/15
to robotframework-users
Confession - I have not worked with AutoItLibrary.
AutoItLibrary is a hybrid library - some keywords are defined directly and some via a get_keyword_names method. I bet the call to get_keyword_names is failing. That method inspects what methods a COM object exposes and something is going wrong here.
I have found that library importing troubleshooting is easier if you do it dynamically.
Remove AutoItLibrary from the test suite. Then add it inside a test case:
    Import Library    AutoItLibrary
You will get more information this way.
Also run the test with the arguments --loglevel DEBUG


Kevin

Ganesh Kumbhar

unread,
Dec 17, 2015, 3:51:44 AM12/17/15
to robotframework-users
Hello Mark and Kevin,

@ Mark : 
I tried removing commas in argument still same error. As per I know, It's nothing to do with arguments syntax because It's not recognising the keyword itself.
In general, If RF recognises the keyword then It will give argument error i.e. need argument error if not provided any argument or wrong keyword if it's wrong.

So No clue, what is causing this problem :(

@ Kevin : 

I tried Removing AutoItLibrary from the test suite. Then added it inside a test case as below 

   Import Library    AutoItLibrary 

still same problem.

If we remove "Library AutoIt Library" and  replace it with "Import Library    AutoItLibrary " then It won't recognise any of the keywords including Get Version.
So We have to keep "Library AutoIt Library" only, I guess.

Also "--loglevel DEBUG" also not giving any other info :( 

I have attached my workspace with batch file to be run.
You can try at your side also by just unzipping it 

 

TestAutoIt_1.7z

wowberk

unread,
May 6, 2016, 3:19:08 AM5/6/16
to robotframework-users
I have the same problem.
I see the AutoIt library is registered in the system, but ... the keywords that are not found are the keywords in the dll library. keywords in python are found perfectly.

any suggestions.

Taylor, Martin

unread,
May 10, 2016, 2:34:54 PM5/10/16
to jrv...@gmail.com, robotframework-users

The setup.py for AutoIt Library does some “magic” to make the keywords from the DLL visible to Python. If you re-install AutoIt Library you should get these.  If you’re interested in “magic”, here’s the relevant code:

 

    #

    # Install the 3rd party packages

    #

    if sys.argv[1].lower() == "install" :

        if os.name == "nt" :

            #

            # Install and register AutoItX

            #

            instDir = os.path.normpath(os.path.join(get_python_lib(), "AutoItLibrary/lib"))

            if not os.path.isdir(instDir) :

                os.makedirs(instDir)

            instFile = os.path.normpath(os.path.join(instDir, "AutoItX3.dll"))

            shutil.copyfile("3rdPartyTools/AutoIt/AutoItX3.dll", instFile)

            #

            # Register the AutoItX COM object

            # and make its methods known to Python

            #

            cmd = os.path.abspath(os.path.join(os.getenv("SYSTEMROOT"), "system32/regsvr32.exe"))

            print "Running '%s /S %s' to register AutoItX3.dll" % (cmd, instFile)

            Elevate.RunCommandAsAdminAndWait(60, cmd, "/S "+instFile)

            #

            # Make sure we have win32com installed

            #

            makepy = os.path.normpath(os.path.join(get_python_lib(), "win32com/client/makepy.py"))

            if not os.path.isfile(makepy) :

                print "AutoItLibrary requires win32com. See http://starship.python.net/crew/mhammond/win32/."

                sys.exit(2)

 

            cmd = "python %s %s" % (makepy, instFile)

            print "Running '%s' to make Python aware of AutoItX3.dll" % cmd

            subprocess.check_call(cmd, stderr=subprocess.STDOUT)

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

wowberk

unread,
May 10, 2016, 4:28:54 PM5/10/16
to robotframework-users
solved by installing python 64


El miércoles, 16 de diciembre de 2015, 10:51:21 (UTC+1), Ganesh Kumbhar escribió:
Reply all
Reply to author
Forward
0 new messages