RobotFramework 不是一个测试工具,准确来说,它是一个自动化测试框架,或者说它是一个自动化测试平台。他拥有的特性如下:

参考环境搭建步骤
参考元素定位
参看基本使用
已云课登录为例, 记录每一步操作即可完成一个登录流程

*** Settings ***
Library Selenium2Library
*** Test Cases ***
正常登录
open browser https://staging.shiyanlou.com/ gc
Maximize Browser Window
Click Element //a[text()='登录'] # 点击登录
Click Element //span[text()='手机登录'] # 选择手机登录
sleep 2
input text //input[contains(@placeholder,'请输入手机号码')] ****** # 输入手机号
input text //input[contains(@placeholder,'请输入密码')] ****** # 输入密码
Click Element //button[@class='!text-18px ant-btn ant-btn-primary ant-btn-block'] # 点击登录
sleep 2
# 判断是否有弹窗
${a} Run Keyword And Return Status Page Should Contain 立即领取
log ${a}
Run Keyword IF ${a}==True Click Element //*[@id="studentsIdentificationCopon___BV_modal_body_"]/div/img
# 判断是否登录成功
Page Should Contain Element //*[@id="__layout"]/div/div[4]/div[1]/div/div[1]/div[1]/div/div/div/div[2]/div/div[1]/div
Mouse Over //*[@id="__layout"]/div/div[2]/div/div/div[2]/div/div/a
sleep 1
Click Element //a[text()='退出登录']
Wait Until Element Is Visible //a[text()='登录'] timeout=5
close all browsers


