zoukankan      html  css  js  c++  java
  • RF-创建一个自定义关键字库

    仓库自定义库

    这里以Selenium2Library库进行举例说明:
    编写一个自定义仓库类(与库文件夹名一致),继承关键字类,指定范围和版本即可。
    需要声明__init__。

    import os
    from keywords import *
    from version import VERSION
    from utils import LibraryListener
    
    __version__ = VERSION
    
    class Selenium2Library(
        _LoggingKeywords,
        _RunOnFailureKeywords,
        _BrowserManagementKeywords,
        _ElementKeywords,
        _TableElementKeywords,
        _FormElementKeywords,
        _SelectElementKeywords,
        _JavaScriptKeywords,
        _CookieKeywords,
        _ScreenshotKeywords,
        _WaitingKeywords,
        _AlertKeywords
    ):
        """库说明信息"""
        ROBOT_LIBRARY_SCOPE = 'GLOBAL'
        ROBOT_LIBRARY_VERSION = VERSION
    

    设置仓库参数
    这里以为例:这里导入仓库时就可以设置隐式等待时间。

    def __init__(self,
                     timeout=5.0,
                     implicit_wait=0.0,
                     run_on_failure='Capture Page Screenshot',
                     screenshot_root_directory=None
        ):
    


    注意:修改文件后要记得删除pyc文件并重启RIDE

  • 相关阅读:
    操作系统
    Typora
    C++
    linux sftp 和scp 运用
    python GIL锁与多cpu
    django model 高级进阶
    django template 模板
    django view 视图控制之数据返回的视图函数
    django 创建管理员用户
    jango 模型管理数据model入门
  • 原文地址:https://www.cnblogs.com/liehen2046/p/11187252.html
Copyright © 2011-2022 走看看