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}

webDriver API——第7部分Desired Capabilities的更多相关文章

  1. python2.7运行selenium webdriver api报错Unable to find a matching set of capabilities

    在火狐浏览器33版本,python2.7运行selenium webdriver api报错:SessionNotCreatedException: Message: Unable to find a ...

  2. <译>Selenium Python Bindings 6 - WebDriver API

    本章涉及Selenium WebDriver的所有接口. Recommended Import Style 推荐的导入风格如下: from selenium import webdriver 然后,你 ...

  3. python+selenium自动化软件测试(第2章):WebDriver API

    2.1 操作元素基本方法 前言前面已经把环境搭建好了,从这篇开始,正式学习selenium的webdriver框架.我们平常说的 selenium自动化,其实它并不是类似于QTP之类的有GUI界面的可 ...

  4. 2.28 查看webdriver API

    2.28 查看webdriver API(带翻译) 前言    前面都是点点滴滴的介绍selenium的一些api使用方法,那么selenium的api到底有多少呢?本篇就教大家如何去查看seleni ...

  5. webdriver API study

    This chapter cover all the interfaces of Selenium WebDriver. Recommended Import Style The API defini ...

  6. Selenium with Python 009 - WebDriver API

    官方API文档:https://seleniumhq.github.io/selenium/docs/api/py/api.html 更多详情,最好的学习方式可以查阅官方API文档或直接阅读源码,本文 ...

  7. Appium 工作原理及 Desired Capabilities

    一.Appium工作原理 脚本请求 --> 4723端口appium server --> 解析参数给PC端4724端口 --> 发送给设备4724端口 --> 通过设备472 ...

  8. Webdriver API (二)

    (转载) 1.3 打开测试页面 对页面对测试,首先要打开被测试页面的地址(如:http://www.google.com),web driver 提供的get方法可以打开一个页面: // And no ...

  9. Selenium2+Python:Webdriver API速记手册

    由于web自动化常常需要控制浏览器行为和操作页面元素,相关函数又比较多,于是再此记下一份Webdriver API查阅文档以备不时之需. 参考:虫师<Selenium2自动化测试实战>,和 ...

随机推荐

  1. BZOJ2654/COGS1764 [2012国家集训队]tree(陈立杰) [生成树,二分]

    BZOJ传送门,COGS传送门 tree Description 给你一个无向带权连通图,每条边是黑色或白色.让你求一棵最小权的恰好有need条白色边的生成树. 题目保证有解. Input 第一行V, ...

  2. 【tomcat】获取访问者真实IP

    1.直接访问tomcat的情况 通过下面这段代码可以获取: String ip = request.getHeader("x-forwarded-for"); if(ip == n ...

  3. [NOI 2011][BZOJ 2434] 阿狸的打字机

    传送门 AC自动机 + 树状数组 建成AC自动机后,设end[i]为第i个串的末尾在Trie树上的节点. 可以发现,对于一个询问(x,y),ans等于Trie树上root到end[y]这条链上fail ...

  4. [xsy2289]B

    题意:给一棵树,一次操作定义为删掉一条树边再加一条边,并且满足加完边后这还是一棵树,问在进行不超过$k$次操作后能构造出多少种不同的树 首先...矩阵树定理在边有边权的时候同样适用,这时可以把它看成重 ...

  5. view加阴影和边框

    UIImageView *imgvPhoto  = [UIImageView alloc] init]; //添加边框   CALayer *layer = [_imgvPhoto layer];   ...

  6. Problem D: 调用函数,输出Fibonacci数列的m项至n项

    #include<stdio.h> int fib(int n)//定义FIbonacci函数 { int s,i; ||n==) { s=; } else { int s1,s2; s1 ...

  7. (转)Linux下数据段的区别(数据段、代码段、堆栈段、BSS段)

    进程(执行的程序)会占用一定数量的内存,它或是用来存放从磁盘载入的程序代码,或是存放取自用户输入的数据等等.不过进程对这些内存的管理方式因内存用途 不一而不尽相同,有些内存是事先静态分配和统一回收的, ...

  8. pcap报文格式

    pcap报文格式 pcap报文整体格式 pcap 报文头格式 pcap报文格式,黄色部分为报文头 pcapng报文格式 PCAPNG: PCAP Next Generation Dump File F ...

  9. Spring Dataflow批处理框架在OCP上的部署

    详细参考 https://donovanmuller.blog/spring-cloud-dataflow-server-openshift/docs/1.2.1.RELEASE/reference/ ...

  10. [转]Understanding Integration Services Package Configurations

    本文转自:http://msdn.microsoft.com/en-us/library/cc895212.aspx Introduction With the 2008 release, SQL S ...