*** Settings ***
Documentation This is the script for Create Sales Visit Repository
Library AutoItLibrary 5 ${True}
*** Test Cases ***
You should pass the above arguments to the Library , timeout and takescreenshot arguments are mandatory.
use pip install robotframework-autoitlibrary
to install the library.
Refer below stackoverflow discussion for more information: “No Keyword with name” error while using AutoIt Library Robot Framework.
The robotframework autoIt documentation is not much dependable, the documentation says that the library expects 3 parameters to constructor but when we check the init file we see that only 2 are required:
robotframework-autoitlibrary/src/AutoItLibrary/__init__.py.
To uplaod file:
File upload in Chrome browser
control focus [CLASS:#32770; TITLE:Open] ${EMPTY} [CLASSNN:Edit1]
control send [CLASS:#32770; TITLE:Open] ${EMPTY} [CLASSNN:Edit1] C:\\File_Upload\\Test_Upload
control click [CLASS:#32770; TITLE:Open] ${EMPTY} &Open
File upload in Firefox browser
control focus File Upload ${EMPTY} [CLASSNN:Edit1]
control send File Upload ${EMPTY} [CLASSNN:Edit1] C:\\File_Upload\\Test_Upload
control click File Upload ${EMPTY} &Open
Read more documentation, the class , title etc are find using autoit finder which will be available inside the 3rdpartytools in robotframework autoit folder. But in the above code you just have to change the file name to be uploaded
Final Code:
*** Settings ***
Documentation This is the script for Create Sales Visit Repository
Library AutoItLibrary 5 ${True}
*** Test Cases ***
Input Text
Wait For Active Window Open
control focus [CLASS:#32770; TITLE:Open] ${EMPTY} [CLASSNN:Edit1]
control send [CLASS:#32770; TITLE:Open] ${EMPTY} [CLASSNN:Edit1] C:\\Users\\AdsKu\\Downloads\\MyData.txt
control click [CLASS:#32770; TITLE:Open] ${EMPTY} &Open