zoukankan      html  css  js  c++  java
  • Python3+RobotFramework自动化测试七:SeleniumLibrary web测试-百度搜索和邮箱登录

    一、百度搜索实例
    前面已经举例过百度搜索的一个例子,这次用上后面的学习到的关键字再复习下
    *** Settings ***
    Library           Selenium2Library
     
     
    *** Test Cases ***
    baidu_search_case
        Open Browser    http://www.baidu.com    chrome
        Input Text    id=kw    selenium
        Click Button    id=su
        sleep    2
        ${title}    Get Title
        should contain    ${title}    selenium_百度搜索
        close Browser
     
    二、邮箱登录实例
    主要使用select frame关键字切换表单,登录按钮要用click element关键字
    *** Settings ***
    Library           Selenium2Library
     
     
    *** Test Cases ***
    login_mail_case
        Open Browser    https://www.126.com    chrome
        sleep    3
        Select Frame    xpath=//div[@id="loginDiv"]/iframe
        Input Text    name=email    username
        Input Text    name=password    password
        Click element    id=dologin
        Unselect Frame
        Close Browser
     
  • 相关阅读:
    github使用及介绍
    git分支 & git标签
    nginx配置文件参考
    PHP优化
    Nginx优化
    Git安装及基础命令使用
    JavaScript框架设计-node节点
    论文爬取(一)
    JAVA日报
    JAVA日报
  • 原文地址:https://www.cnblogs.com/daydayup-lin/p/12921893.html
Copyright © 2011-2022 走看看