RobotFramework

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)

在这里插入图片描述

  1. 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
在这里插入图片描述

  1. 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 )

在这里插入图片描述

  1. Put your web driver under ‘C:\Python\Python37\Scripts’ (your python path)

在这里插入图片描述

  1. 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

  1. Input ‘ride.py’ in the command line and press enter, your installation is successful if you see the following interface.

在这里插入图片描述
在这里插入图片描述

  1. (Optional) Create RIDE Desktop Shortcut
    在这里插入图片描述

You can start RIDE with a double click on the icon. (CMD also applies)
在这里插入图片描述

How to Use

  1. Open RobotProject as shown below:
    在这里插入图片描述

  2. 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.

在这里插入图片描述

  1. 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.

在这里插入图片描述

  1. Preferences like font size and keyword colors can be modified as shown below:

在这里插入图片描述

在这里插入图片描述

Problems

  1. 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).

在这里插入图片描述
在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值