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}
webDriver API——第7部分Desired Capabilities的更多相关文章
- 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 ...
- <译>Selenium Python Bindings 6 - WebDriver API
本章涉及Selenium WebDriver的所有接口. Recommended Import Style 推荐的导入风格如下: from selenium import webdriver 然后,你 ...
- python+selenium自动化软件测试(第2章):WebDriver API
2.1 操作元素基本方法 前言前面已经把环境搭建好了,从这篇开始,正式学习selenium的webdriver框架.我们平常说的 selenium自动化,其实它并不是类似于QTP之类的有GUI界面的可 ...
- 2.28 查看webdriver API
2.28 查看webdriver API(带翻译) 前言 前面都是点点滴滴的介绍selenium的一些api使用方法,那么selenium的api到底有多少呢?本篇就教大家如何去查看seleni ...
- webdriver API study
This chapter cover all the interfaces of Selenium WebDriver. Recommended Import Style The API defini ...
- Selenium with Python 009 - WebDriver API
官方API文档:https://seleniumhq.github.io/selenium/docs/api/py/api.html 更多详情,最好的学习方式可以查阅官方API文档或直接阅读源码,本文 ...
- Appium 工作原理及 Desired Capabilities
一.Appium工作原理 脚本请求 --> 4723端口appium server --> 解析参数给PC端4724端口 --> 发送给设备4724端口 --> 通过设备472 ...
- Webdriver API (二)
(转载) 1.3 打开测试页面 对页面对测试,首先要打开被测试页面的地址(如:http://www.google.com),web driver 提供的get方法可以打开一个页面: // And no ...
- Selenium2+Python:Webdriver API速记手册
由于web自动化常常需要控制浏览器行为和操作页面元素,相关函数又比较多,于是再此记下一份Webdriver API查阅文档以备不时之需. 参考:虫师<Selenium2自动化测试实战>,和 ...
随机推荐
- HRBUST 1212 乘积最大
$dp$,大数运算. $dp[i][j]$表示到$i$位置切成了$j$段的最大收益.数字爆$longlong$,$Java$上大数. import java.math.BigInteger; impo ...
- 洛谷P1565牛宫
传送门:题目点这里; 首先理解题目,就是要求给定矩阵中权值和不小于零的最大子矩阵,数据范围200也还不算棘手,暴力n^4的算法也可以水到50分.正解要用到单调栈配合二分和前缀和,复杂度n^3logn, ...
- CodeForces 809D Hitchhiking in the Baltic States(FHQ-Treap)
题意 给你长度为$n$的序列,序列中的每个元素$i$有一个区间限制$[l_i,r_i]$,你从中选出一个子序列,并给它们标号$x_i$,要求满足 $,∀i<j,x_i<x_j$,且$, ∀ ...
- git "Could not read from remote repository.Please make sure you have the correct access rights."解决方案
我们在使用git clone 或其他命令的时候,有时候会遇到这类问题,如图: fatal: Could not read from remote repository.Please make sure ...
- Linux前后台进程切换
(1).Linux前台进程与后台进程的区别 前台进程:是在终端中运行的命令,那么该终端就为进程的控制终端,一旦这个终端关闭,这个进程也随之消失. 后台进程:也叫守护进程(Daemon),是运行在后台的 ...
- C++-STL-(map用法)
http://blog.csdn.net/sunshinewave/article/details/8067862
- HashMap的实现原理 HashMap底层实现,hashCode如何对应bucket?
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha 数组和链表组合成的链表散列结构,通过hash算法,尽量将数组中的数据分布均匀,如果has ...
- 【动态规划】Gym - 101201A - Alphabet
题意:一个字符串被定义为“alphabetical”,当且仅当它能够删除一些字符,变成“ab...yz”,给你一个只由小写字母组成的字符串,问你最少插入几个字母,使它变成“alphabetical”的 ...
- Java反射机制的简单学习
今天看了一下Java的反射机制,就此记录一下. 首先,我们要先了解一下什么是反射? 反射的概念是由Smith在1982年首次提出的,主要是指程序可以访问.检测和修改它本身状态或行为的一种能力. JAV ...
- 如何通俗理解——>集群、负载均衡、分布式
转自:周洲 (Julie) 在“高并发,海量数据,分布式,NoSql,云计算......”概念满天飞的年代,相信不少朋友都听说过甚至常与人提起“集群,负载均衡”等,但不是所有人都有机会真正接触到这些技 ...