与crossbrowsertesting.com提供的api对话的python库

python-xbtesting的Python项目详细描述


与[crossbrowsertesting.com]提供的api通信的python库(http://crossbrowsertesting.com/)。

免责声明:我与CrossBrowserTesting.com,LLC没有任何关联。

安装

$ pip install python-xbtesting

###先决条件

  • simplejson

用法

###设置

>>> from xbtesting import XBTesting
>>> XBTesting.username = "your username"
>>> XBTesting.password = "your password"
>>> xbt = XBTesting()

###检索测试

>>> tests = xbt.get_tests()
>>> tests
[<xbtesting.xbtesting.XBTest object at 0x1011a3850>,
 <xbtesting.xbtesting.XBTest object at 0x1011a39d0>,
 <xbtesting.xbtesting.XBTest object at 0x1011a3a50>,
 <xbtesting.xbtesting.XBTest object at 0x1011a3b50>,
 <xbtesting.xbtesting.XBTest object at 0x1011a3b90>]
>>> tests[0].id
98765
>>> tests[0].url
'http://your-website.com/'
>>> tests[0].test_date
datetime.datetime(2010, 12, 13, 8, 4, 28)

####XBText实例的可用属性

  • id(int)
  • 网址(str)
  • 测试日期(日期时间)

###检索测试版本

>>> versions = test[0].get_versions()
>>> versions
[<xbtesting.xbtesting.XBTestVersion object at 0x1011b8150>,
 <xbtesting.xbtesting.XBTestVersion object at 0x1011b8190>
]
>>> versions[0].id
876543
>>> versions[0].version_date
datetime.datetime(2010, 12, 13, 8, 4, 28)

####xbtestversion实例的可用属性

  • id(int)
  • 测试(xbtest)
  • 版本日期(日期时间)
  • 计数成功(int)
  • 未完成计数(int)
  • 公共版网址(str)
  • 版本用户界面URL(str)
  • 版本压缩(str)
  • w3c\u css错误(int)
  • w3c\u html错误(int)
  • w3c_html_警告(int)

###检索测试版本的结果

>>> results = versions[0].get_results()
>>> results
[<xbtesting.xbtesting.XBTestVersionResult object at 0x100750650>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750190>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x1007501d0>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750290>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750310>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750350>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750390>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x1007503d0>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750410>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750450>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x1007504d0>,
 <xbtesting.xbtesting.XBTestVersionResult object at 0x100750510>]
>>> results[0].id
7654321
>>> results[0].finished_date
datetime.datetime(2011, 1, 18, 8, 34)
>>> results[0].full_page
'http://media.crossbrowsertesting.com/users/12345/screenshots/full/z02129bb861061d1a052.png'
>>> results[0].browser
'Firefox 3.5'
>>> results[0].os
'Mac OSX 10.5.8'
>>> results[0].resolution
'1024x768'

####xbtestversionresult实例的可用属性

  • id(int)
  • 测试版本(xbtestversion)
  • 开始日期(日期时间)
  • 完成日期(日期时间)
  • 状态(str)
  • 操作系统(str)
  • 浏览器(str)
  • 分辨率(str)
  • 窗口化(str)
  • 窗口化的拇指(str)
  • 整页(str)
  • 整页大拇指(str)
  • 现场测试网址(str)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Jetty是否有请求缓存?   数组中的java 2值与我的数据帧中的2列对应   对象序列化期间的java DbUtils类型转换问题   java根面板中不显示所有单独的面板   java通过代理或SSH隧道连接Hbase API   java困惑:与经典MVC控制器相比,JSF2中bean的角色   java在我的Triangle类中“找不到符号错误”   java在Android中设置从路径到自定义按钮的图像   java不绕轨道旋转椭圆   AES在socket上搞砸了序列化/反序列化。无效的流标头。JAVA   java在数组中搜索term和if语句   线程“main”java中出现异常。util。正则表达式。PatternSyntaxException:在索引0附近悬挂元字符“*”*   Websphere上的java Google反射无法打开url连接   java为什么inc/dec频道什么都不做?   java KeyListener无法访问keyPressed方法