zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    使用公用表表达式(CTE)简化嵌套SQL WITH AS的含义
    C#中Array与ArrayList的区别
    Asp.net 网页中的嵌入式代码
    Asp.net核心对象
    Latex学习(载入图片并居中)
    matlab练习程序(生成加密p文件)
    matlab练习程序(直方图反向投影)
    matlab练习程序(非负矩阵分解)
    matlab练习程序(PSNR)
    matlab练习程序(动感模糊)
  • 原文地址:https://www.cnblogs.com/miniren/p/4885752.html
Copyright © 2011-2022 走看看