• Robot Framework selenium2library 常用关键字


    Selenium Library

    SeleniumLibrary is a Robot Framework test library that uses the popular Selenium web testing tool internally. It provides a powerful combination of simple test data syntax and support for different browsers. In addition to standard web testing, the library also supports testing Adobe Flex/Flash applications.

    Selenium2Lib keyword:

    (1)operate browser:
     --Open Browser
     --Maximize Browser Window
     --Go To
     --Reload Page
     --Close Window
     --Close Browser
     --Close All Browsers


    (2)click
     --Click Button|locator
     --Click Element|locator
     --Click Image|locator
     --Click Link|locator
     --Double Click Element|locator


    (3)locator:we could locate UI element with id/name/xpath/dom
     --identifier: Click Element|identifier=my_element (matches by @id or @name)
     --id         : Click Element|id=my_element (matches by @id)
     --name      : Click Element|name=my_element(matches by @name)
     --xpath     : Click Element|xpath=//div[@id='my_element']
     --link      : Click Element|link=my_link
     --css         : Click Element|css=div.my_class
     --tag         : Click Element|tag=div
    ps:if the element is in a frame/iframe,we could locate it by : Select Frame| locator


    (4)input
     --Input Password|locator| text
     --Input Text|locator|text


    (5)press
     --Press Key|locator|Key


    (6) verify:
     --Page Should (Not) Contain Button/Checkbox/Element/Image/Link/List/Radio Button/Textfield
     --Location should Be/Contain
     --Title Should Be
     --Current Frame Contains
     --Page Should (Not) Contain
     --Textfield Value Should Be
     --Element Should Be Disabled/Enabled/Visible/Contain
     --List Selection Should Be
     --List Should Have No Selections
     --Checkbox Should (Not) Be Selected
     --Radio Button Should Be Set To
     --Radio Button Should Not Be Selected
     --Table Cell/Column/Footer/Header/Row/ Should Contain
     --Xpath Should Match X Times


    (7)wait
    selenium2 will wait page load finished default,but we can also use keywords:
     --Wait For Condition| condition|timeout=None|error=None
     --Wait Until Page Contains|text|timeout=None|error=None
     --Wait Until Page Contains Element|locator|timeout

  • 相关阅读:
    位置定位 api
    代理相关
    手机网页 右边的空白区
    sip介绍
    测试浏览器对html5支持
    sencha touch
    PC上的手机模拟器大全(安卓/苹果/黑莓/塞班/微软)
    测试视频
    android 环境配置 与 运行错误
    android 一年过期
  • 原文地址:https://www.cnblogs.com/miniren/p/4885758.html
Copyright © 2020-2023  润新知