Project address: https://citcon.atlassian.net/wiki/spaces/ENG/pages/2124940283
Preparation Work
1.Install PythonEnter the following address in your browser to start downloading:https://www.python.org/ftp/python/3.7.6/python-3.7.6-amd64.exe (for windows)
https://www.python.org/ftp/python/3.7.6/ (for mac)
- This step is optional if you check “Add Python 3.7 to PATH” while installing python.
Add the following path (your installation directory) in system variables :
C:\Python\Python37\ , C:\Python\Python37\Scripts
- Download web driver after system environment variables are set up:
(1)firefox driver: (mac & windows, Download address:Releases · Mozilla/geckodriver )
(2)chrome driver: (The version of chrome driver needs to be the same as your browser. Download address:https://chromedriver.storage.googleapis.com/index.html )
- Put your web driver under ‘C:\Python\Python37\Scripts’ (your python path)
- Run CMD as an administrator, after the PIP command displays the usage properly, you can install the required libraries with the following commands:
(1) install with requirements.txt (recommend):
enter the directory where you put requirements.txt, input commond: pip install -r requirements.txt
(2)install with following commands:
pip install wxPython==4.0.7.post2
pip install robotframework
pip install robotframework-ride
pip install robotframework-seleniumlibrary==3.2.0
pip install robotframework-selenium2library
pip install robotframework-sshlibrary
pip install robotframework-databaselibrary
pip install robotframework-requests
pip install robotframework-jsonlibrary
pip install selenium
pip install requests
pip install pymysql
pip install sshtunnel
- Input ‘ride.py’ in the command line and press enter, your installation is successful if you see the following interface.
- (Optional) Create RIDE Desktop Shortcut
You can start RIDE with a double click on the icon. (CMD also applies)
How to Use
-
Open RobotProject as shown below:
-
Hold down Ctrl and move your mouse above the keyword to see the arguments. Arguments like case/env are mandatory, others in the form of key-value pairs are optional.
- Press the ‘Run Tests’ button (or F8) to run the selected test cases. Multiple test scenarios (all the blue ones) can be run within a case.
- Preferences like font size and keyword colors can be modified as shown below:
Problems
- If your case fails and the error message shows like “No keyword with name ‘Open Browser’ found.”:
Check the color of ‘Open Browser’ in keyword ‘klarna_pay_for_capture_new’, if it shows in black, you need to check your version of seleniumlibrary and selenium2library with the command 'pip list’:
If you find your seleniumlibrary in the version of 5 and selenium2library in the version of 3, reinstall seleniumlibrary to make sure it is in the same version with selenium2library (Use the command ‘pip install robotframework-seleniumlibrary==3.2.0’, and don’t forget to run CMD as an administrator).