1.新建一个features包,在新建一个steps包

2.新建一个register.features文件

#coding=utf-8
Feature:Register User
As a developer
This is my first bdd project
Scenario:open register website
When I open the register website
Then I expect that title is "注册"

3.新建一个environment文件

#coding=utf-8
from selenium import webdriver
def before_all(context):
context.driver=webdriver.Chrome()
def after_all(context):
context.driver.close()
4.新建一个register_user的python文件
#coding=utf-8
from behave import *
use_step_matcher('re') @when('I open the register website')
def step_register(context):
context.driver.get("http://www.5itest.cn/register")
@then('I expect that title is "([^"]*)"')
def step_register1(context,title_name):
title=context.driver.title
assert title_name in title
4.要在命令运行 behave

web自动化的行为驱动的更多相关文章

  1. web自动化_浏览器驱动chromedriver安装方法(适用RF框架/Selenium/Appium)

    在进行UI自动化时,打开浏览器是第一步,这就必须要安装浏览器的驱动,chrome浏览器需要安装chromedriver,下载地址:http://chromedriver.storage.googlea ...

  2. web自动化-selenium+Chrome驱动国内下载地址+驱动对应Chrome版本号

    selenium各版本下载地址 http://selenium-release.storage.googleapis.com/index.html 国内下载:http://npm.taobao.org ...

  3. web自动化浏览器chrome和驱动chromedriver

    1.web自动化下载浏览器和对应的浏览器驱动,以谷歌浏览器为例 电脑上安装谷歌浏览器,查看谷歌浏览器的版本,输入chrome://settings/help 2.chromedriver国内镜像地址h ...

  4. Selenium Web 自动化 - 项目实战(三)

    Selenium Web 自动化 - 项目实战(三) 2016-08-10 目录 1 关键字驱动概述2 框架更改总览3 框架更改详解  3.1 解析新增页面目录  3.2 解析新增测试用例目录  3. ...

  5. Web自动化之Headless Chrome概览

    Web自动化 这里所说的Web自动化是所有跟页面相关的自动化,比如页面爬取,数据抓取,页面内容检测,页面功能测试,页面加载性能测试,页面回归测试等等,当前主要由如下几种解决方式: 文本数据获取 这就是 ...

  6. Web自动化之Headless Chrome测试框架集成

    使用Selenium操作headless chrome 推荐 简介 WebDriver是一个W3C标准, 定义了一套检查和控制用户代理(比如浏览器)的远程控制接口,各大主流浏览器来实现这些接口以便调用 ...

  7. WEB自动化(Python+selenium)的API

    在做Web自动化过程中,汇总了Python+selenium的API相关方法,给公司里的同事做了第二次培训,分享给大家                                         ...

  8. Selenium Web 自动化 - 项目实战(一)

    Selenium Web 自动化 - 测试框架(一) 2016-08-05 目录 1 框架结构雏形2 把Java项目转变成Maven项目3 加入TestNG配置文件4 Eclipse编码修改5 编写代 ...

  9. python selenium - web自动化环境搭建

    前提: 安装python环境. 参考另一篇博文:https://www.cnblogs.com/Simple-Small/p/9179061.html web自动化:实现代码驱动浏览器进行点点点的操作 ...

随机推荐

  1. 最小堆的两种实现及其STL代码

    #include<cstdio> #include<iostream> #include<algorithm> #include<vector> boo ...

  2. Xmemcached使用之与Spring整合

    转自:http://hi.baidu.com/tjbaso/item/22f3c32b062ebefb50fd87b8 1 简介Xmemcached是一个高性能的基于java nio的memcache ...

  3. 阿伦 凯 Alan Kay 面向对象编程思想创始人

    The best way to predict the future is to invent it. 预测未来最好的办法就是创造它.

  4. [RxJS 6] The Catch and Rethrow RxJs Error Handling Strategy and the finalize Operator

    Sometime we want to set a default or fallback value when network request failed. http$ .pipe( map(re ...

  5. Python常用模块【sys】

    sys.argv 参数    「argv」是「argument variable」参数变量的简写形式.一般在命令行调用的时候由系统传递给程序.这个变量其实是一个List列表,argv[0] 一般是“被 ...

  6. 菜鸟nginx源代码剖析数据结构篇(六) 哈希表 ngx_hash_t(上)

    菜鸟nginx源代码剖析数据结构篇(六) 哈希表 ngx_hash_t(上) Author:Echo Chen(陈斌) Email:chenb19870707@gmail.com Blog:Blog. ...

  7. C++虚函数默认实参的注意事项

    我们都知道当成员函数是虚函数的时候,函数调用取决于调用函数的对象的类型而不是指针或者应用的类型.这就是C++中的多态. 那么一个虚函数的实参的缺省值是什么呢?例如如下代码: #include < ...

  8. iOS开发之KVC全解

    一  KVC的基本概念 1.KVC是Key Value Coding的缩写,意思是键值编码. 在iOS中,提供了一种方法通过使用属性的名称(也就是Key)来间接访问对象属性的方法,这个方法可以不通过g ...

  9. HTML中的文本框textarea标签

    转自:https://www.jb51.net/web/183411.html <textarea></textarea>用来创建一个可以输入多行的文本框,此标志对用于< ...

  10. A Round Peg in a Ground Hole(圆与凸包)

    http://poj.org/problem?id=1584 题意:判断所给的点能不能形成凸包,并判断所给的圆是否在凸包内. 改了好几天的一个题,今天才发现是输入顺序弄错了,办过的最脑残的事情..sa ...