• Robot Framework web测试demo


    1.Open RIDE: ride.py


    2.New Project: "File" -> "New Project" ,click "OK".
        Name:Robot_Demo
        Type:Directory
    ps:The difference between File and Directory is: We can write test case in File ,but Directory not.
    Robot Framework test data is defined in tabular format, using either hypertext markup language (HTML), tab-separated values (TSV), plain text, or reStructuredText (reST) formats.


    3.right click "Robot_Demo",choose "New Resource".click "OK".
        Name:resource
    ps:We could put variables and higher-level user keywords in this file,then make testsuite invoked this resource file .


    4.Import "selenium2library":Open "resource.txt",click "Library",input "Selenium2Library" in "Name".Click "OK".


    5. right click "Robot_Demo",choose "New Suite" ,click "OK".
        Name:TestSuite1
        Type:File


    6.Import "resource.txt":Open "TestSuite1",click "Resource",input "resource.txt" in "Path".Click "OK".


    7.right click "TestSuite1" , choose "New Test Case",click "OK".
        Name:TestCase1


    8.Edit test case "TestCase1":
        Open Browser    http://www.baidu.com    
        Maximize Browser Window        
        Input Text    id=kw    Robot
        Click Button    id=su    
        Close Browser        
    ps: "Open Browser" is a selenium defined keyword, so it's marked with blue color.We could search all the keyword by "F5".
    We could also set every test case with a "Tags": Edit->Settings->Tags.So that we could run test cases with special tags.


    9.Run. Click Tab page "Run"->"Start".Then we could see the browser open with "http://www.baidu.com".


    10.After it finished running,we could see the report by "Run"->"Report".
    ps: If it failed,we could find the failed step screen shot in log: Run-> Log.

  • 相关阅读:
    RESTful风格的API
    案例:toDoList
    jQuery中的Ajax
    php 使用kafka
    crontab不执行
    php两种实现守护进程的方式
    crontab不执行脚本,手动调测又没有任何问题
    centos7 安装跳板机(堡垒机)
    Ubuntu修改默认键盘布局的方法
    openresty nginx升级版
  • 原文地址:https://www.cnblogs.com/miniren/p/4885752.html
Copyright © 2020-2023  润新知