I am writing robot tests for web testing using Google’s Robot Framework with SeleniumLibrary (a test library) , one of my test involves uploading a file from the desktop by clicking on a”Browse” button on the webpage and using the windows file explorer window that pops up to navigate to and select the file ( providing a text path to file is disabled on the website for security reasons.) I have tried digging around but found little on automating this Windows File Explorer action , is there a way I can do this ?
After downloading the AutoIt library and trying to install it is asking for wincom32./python window extensions.And i am trying to install it is giving some error like
Building pywin32 2.7.217.0
Trace-back (most recent call last):
File "setup.py", line1944, in <module>
""" % dirs).split(),
File "setup.py", line 603, in __init__
if os.path.isfile(os.path.join(sdk_dir, "include", "activdbg.h")):
File"C:\Python27\lib\ntpath.py", line 96 in join
assert len(path) > 0
TypeError: object of type 'NoneType' has no len()
Below is a quick step to step guide to install autoit for robotframework in Windows (as what versions work with what in python is a pain):
First you will need a 32 bit python as autoit will not install for windows 64bit. I have used:
Then from http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/
Download the windows installer so for python 2.6 it will be:
Now on the command prompt go to the location of where you downloaded the autoit files ex:
– cd C:\Development\Downloaded files\AutoItLibrary-1.1
and then type
– python setup.py install
If successful you will see lines in the cmd line such as:
Now run the test
C:\RobotFramework\Extensions\AutoItLibrary\tests
Note: Ensure you have the environment variables set correctly:i.e.
– c:\python26 for python
– c:\python26\scripts for pybot
You can now run your robotframework tests by creating an exe and calling
– Run C:\RobotFramework\Seans Autoit Files\FF_FileUpload.exe
To find how to create the autoit exe visit the autoit website.