zoukankan      html  css  js  c++  java
  • webDriver API——第7部分Desired Capabilities

    The Desired Capabilities implementation.

    class selenium.webdriver.common.desired_capabilities.DesiredCapabilities

    Bases: object

    Set of default supported desired capabilities.

    Use this as a starting point for creating a desired capabilities object for requesting remote webdrivers for connecting to selenium server or selenium grid.

    Usage Example:

    from selenium import webdriver

    selenium_grid_url = “http://198.0.0.1:4444/wd/hub

    # Create a desired capabilities object as a starting point. capabilities = DesiredCapabilities.FIREFOX.copy() capabilities[‘platform’] = “WINDOWS” capabilities[‘version’] = “10”

    # Instantiate an instance of Remote WebDriver with the desired capabilities. driver = webdriver.Remote(desired_capabilities=capabilities,

    command_executor=selenium_grid_url)

    Note: Always use ‘.copy()’ on the DesiredCapabilities object to avoid the side effects of altering the Global class instance.

    ANDROID= {'platform': 'ANDROID', 'browserName': 'android', 'version': '', 'javascriptEnabled': True}
    CHROME= {'platform': 'ANY', 'browserName': 'chrome', 'version': '', 'javascriptEnabled': True}
    FIREFOX= {'platform': 'ANY', 'browserName': 'firefox', 'version': '', 'javascriptEnabled': True}
    HTMLUNIT= {'platform': 'ANY', 'browserName': 'htmlunit', 'version': ''}
    HTMLUNITWITHJS= {'platform': 'ANY', 'browserName': 'htmlunit', 'version': 'firefox', 'javascriptEnabled': True}
    INTERNETEXPLORER= {'platform': 'WINDOWS', 'browserName': 'internet explorer', 'version': '', 'javascriptEnabled': True}
    IPAD= {'platform': 'MAC', 'browserName': 'iPad', 'version': '', 'javascriptEnabled': True}
    IPHONE= {'platform': 'MAC', 'browserName': 'iPhone', 'version': '', 'javascriptEnabled': True}
    OPERA= {'platform': 'ANY', 'browserName': 'opera', 'version': '', 'javascriptEnabled': True}
    PHANTOMJS= {'platform': 'ANY', 'browserName': 'phantomjs', 'version': '', 'javascriptEnabled': True}
    SAFARI= {'platform': 'ANY', 'browserName': 'safari', 'version': '', 'javascriptEnabled': True}
  • 相关阅读:
    【openwrt】——lua字符串操作
    Andriod绘图的基础知识
    protect,public,private 的区别
    fatjar 将项目使用的第三方jar包打包(亲测可用)
    TPshop学习(8)微信支付
    HTTP和HTTPS有什么区别? 什么是SSL证书?使用ssl证书优势?
    LNMP安装Let’s Encrypt 免费SSL证书方法:自动安装与手动配置Nginx
    腾讯云中ssL证书的配置安装
    微信小程序:微信登陆(ThinkPHP作后台)
    转载VC6LineNumberAddin 规格严格
  • 原文地址:https://www.cnblogs.com/hushaojun/p/4467491.html
Copyright © 2011-2022 走看看