Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Robotframework install AutoItLibrary

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Because AutoItLibrary depends on the pywin32 library. So to use AutoItLibrary, you must first install pywin32.

1. Download pywin32 and install: http://sourceforge.net/projects/pywin32/files/pywin32/

AutoItLibrary download address: http://code.google.com/p/robotframework-autoitlibrary/ (Note: if using the command to install the pilot package is not successful, download it directly and go to the corresponding setup.py directory to execute python setup.py install for installation)

2, 64-bit machines: in addition to installing the above two, you have to install another AutoItV3 (the latest official website download address: http://www.autoitscript.com/site/autoit-news/autoit-v3-3-10-0-released/, if there is any update in the future, please download it yourself from the home page of the official website). Under normal circumstances, it can be used after loading this.

Today, you need to install the autoitlibrary library on a win7 64-bit system. After installing the robotframework framework at first, there is no problem with importing selenium2lib, and then start installing the autolibrary library.

Download the AutoItLibrary-1.1_x64 installation package from the download address: http://download.csdn.net/detail/liuheng123456/6236097.

After decompressing the package, under the dos command, go to the extracted AutoItLibrary directory, for example: extract the AutoItLibrary-1.1_x64 to disk E, then execute cd E:\ AutoItLibrary-1.1_x64.

Execute python setup.py install to install AutoItLibrary to python27 under the lib library.

Use robotframework to import AutoItLibrary library, always show as an error message, can not be imported normally.

It is found that the autoit program still needs to be installed under the win7 system before robotframework can be imported into the AutoItLibrary library normally.

Find the autoit download address:

Https://www.autoitscript.com/site/autoit/downloads/

Download the latest version of auto_it_3.3.12.exe installation.

After the installation is completed, still can not import AutoItLibrary library normally, depressed, look for information again, found that the need to re-register the AutoItX3.dll file of autoit.

Use cmd to enter the path where the AutoItX3.dll file is located and run the system logout and system registration commands:

C:\ Python27\ Lib\ site-packages\ AutoItLibrary\ lib > regsvr32 / u AutoItX3.dll

C:\ Python27\ Lib\ site-packages\ AutoItLibrary\ lib > regsvr32 / s AutoItX3.dll

After running successfully, re-import the AutoItLibrary library using robotframework, and import it successfully.

There are several problems encountered when installing AutoItLibrary for Robot Framework. Note the solution.

Prerequisite: you must run cmd with administrator privileges.

1. Error message

There are two mistakes to solve:

The first one to report an error

Don't think we need to unregister the old one...

This is because it was detected that the lib already exists in the directory of python

Solution:

If my directory is D:\ Program Files (x86)\ Python27\ Lib\ site-packages\ AutoItLibrary, then you need to empty the files in this directory.

The second error report

Traceback (most recent call last):

File "setup.py", line 70, in

Subprocess.check_call (cmd, shell=True)

File "D:\ Program Files (x86)\ Python27\ lib\ subprocess.py", line 186, in check_call

Raise CalledProcessError (retcode, cmd)

Subprocess.CalledProcessError: Command'% SYSTEMROOT%\ system32\ regsvr32.exe / S D:\ Program Files (x86)

\ Python27\ Lib\ site-packages\ AutoItLibrary\ lib\ AutoItX3.dll' returned non-zero exit status 3

Read this article about the function subprocess.check_call:

Https://blog.csdn.net/liushuibufuqin/article/details/78892831

Solution (forget where it was found at that time, the method is feasible, but not necessarily scientific):

1. Go to the downloaded AutoItLibrary-1.1 folder and open the setup.py file

2. Comment out the subprocess.check_call (cmd, shell=True) of line 70 (the number of lines may be deviated)

3. Comment out the subprocess.check_call (cmd) of line 81 (the number of lines may be incorrect)

Second, the ultimate cause

After the above problems were solved, AutoItLibray was successfully installed, but something even weirder was found:

The installed library is not complete!

Importing AutoItLibray in Robot Framework is ready for use, only to find that keywords such as click button do not work (the colors are not identified). Therefore, using F5 to view keywords is indeed incomplete, with keywords such as open, close, but not click, and so on.

Checked:

1. AutoItLibray has indeed been successfully imported, and it remains intact after being reintroduced for N times.

2. Pywin32 and python version do correspond. At that time, 32-bit was selected for installation, and x86 version was also selected for AutoIt.

Repeatedly search the relevant documents, but still to no avail, so I can only decide to reinstall, and choose 64-bit python (the computer is 64-bit, but I chose to install 32-bit python for fear that the python version is not compatible with pywin32). In addition, I forgot where to see the installation directory without spaces, thinking that python was installed in the Program Files (x86) directory for the same reason, so I chose a directory with no spaces when reinstalling python. After reinstallation, the above two problems do not seem to appear again (I don't quite remember), and AutoItLibray finally works properly.

So all the problems found above are probably caused by the incorrect installation of python. Therefore, be sure to pay attention to the version and installation directory of python.

Author: CYTyeah

Source: CSDN

Original: https://blog.csdn.net/qq_35081227/article/details/81085404

Copyright notice: this article is the original article of the blogger, please attach a link to the blog article to reprint it! There are several problems encountered when installing AutoItLibrary for Robot Framework. Note the solution.

Prerequisite: you must run cmd with administrator privileges.

1. Error message

There are two mistakes to solve:

The first one to report an error

Don't think we need to unregister the old one...

This is because it was detected that the lib already exists in the directory of python

Solution:

If my directory is D:\ Program Files (x86)\ Python27\ Lib\ site-packages\ AutoItLibrary, then you need to empty the files in this directory.

The second error report

Traceback (most recent call last):

File "setup.py", line 70, in

Subprocess.check_call (cmd, shell=True)

File "D:\ Program Files (x86)\ Python27\ lib\ subprocess.py", line 186, in check_call

Raise CalledProcessError (retcode, cmd)

Subprocess.CalledProcessError: Command'% SYSTEMROOT%\ system32\ regsvr32.exe / S D:\ Program Files (x86)

\ Python27\ Lib\ site-packages\ AutoItLibrary\ lib\ AutoItX3.dll' returned non-zero exit status 3

Read this article about the function subprocess.check_call:

Https://blog.csdn.net/liushuibufuqin/article/details/78892831

Solution (forget where it was found at that time, the method is feasible, but not necessarily scientific):

1. Go to the downloaded AutoItLibrary-1.1 folder and open the setup.py file

2. Comment out the subprocess.check_call (cmd, shell=True) of line 70 (the number of lines may be deviated)

3. Comment out the subprocess.check_call (cmd) of line 81 (the number of lines may be incorrect)

Second, the ultimate cause

After the above problems were solved, AutoItLibray was successfully installed, but something even weirder was found:

The installed library is not complete!

Importing AutoItLibray in Robot Framework is ready for use, only to find that keywords such as click button do not work (the colors are not identified). Therefore, using F5 to view keywords is indeed incomplete, with keywords such as open, close, but not click, and so on.

Checked:

1. AutoItLibray has indeed been successfully imported, and it remains intact after being reintroduced for N times.

2. Pywin32 and python version do correspond. At that time, 32-bit was selected for installation, and x86 version was also selected for AutoIt.

Repeatedly search the relevant documents, but still to no avail, so I can only decide to reinstall, and choose 64-bit python (the computer is 64-bit, but I chose to install 32-bit python for fear that the python version is not compatible with pywin32). In addition, I forgot where to see the installation directory without spaces, thinking that python was installed in the Program Files (x86) directory for the same reason, so I chose a directory with no spaces when reinstalling python. After reinstallation, the above two problems do not seem to appear again (I don't quite remember), and AutoItLibray finally works properly.

So all the problems found above are probably caused by the incorrect installation of python. Therefore, be sure to pay attention to the version and installation directory of python.

The official website https://www.softpedia.com/get/Programming/Components-Libraries/AutoItLibrary.shtml

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report