当前位置: 首页 > news >正文

中国企业网官方网站查询广州竞价托管

中国企业网官方网站查询,广州竞价托管,诸城网站建设费用,网站开发设计的技术数据驱动 数据驱动,指在软件测试领域当中的数据驱动测试(Data-Driven Testing,简称DDT)是⼀种软件测试⽅法,在不同的数据下重复执⾏相同顺序的测试步骤,测试脚本从数据源读取测试数据,⽽不使⽤…

数据驱动

数据驱动,指在软件测试领域当中的数据驱动测试(Data-Driven Testing,简称DDT)是⼀种软件测试⽅法,在不同的数据下重复执⾏相同顺序的测试步骤,测试脚本从数据源读取测试数据,⽽不使⽤硬编码将测试数据写死在代码

测试数据源存放位置:

  • • 直接写在py文件里面

  • • 写在 Json、Excel、CSV、Yaml等文件里面

  • • 存在数据库

  • • 造数脚本

  • • 调用接口获取数据

常见测试框架里面应用:

  • • Pytest:使用装饰器 @pytest.mark.parametrize("xx")

  • • TestNG:使用注解@DataProvider

  • • Junit5:使用注解 @ParameterizedTest+@ValueSource(其中一种,还有其他方式)

示例:

import pytest
from utils.logger import log
from common.config import ini
from PageObject.searchpage import SearchPageclass TestSearch:@pytest.fixture(scope='class', autouse=True)def open_baidu(self, drivers):"""打开百度"""search = SearchPage(drivers, ini.url)search.open_home_page()@pytest.mark.parametrize("input_text, expected", [("selenium","selenium_百度搜索"), ("自动化测试","自动化测试_百度搜索"), ("UI自动化","UI自动化_百度搜索")])def test_search_selenium(self, drivers):"""搜索"""search = SearchPage(drivers)search.input_search_text(input_text)search.click_search_btn()browser_title =  driver.titlelog.info(browser_title)assert browser_title == expected,"浏览器的标题与预期不一致!"if __name__ == '__main__':pytest.main(['TestCase/test_search.py'])

关键字驱动

关键字驱动是指将所有用例依赖的公共步骤,进⾏再次封装,形成关键字,调⽤不同的关键字组合实现不同的业务逻辑,从⽽驱动测试⽤例执⾏

关键字驱动的实现方法一般有两种:

  • • 第一种:自己手动实现关键字,进行公共步骤的二次封装

  • • 第二种:自动化测试框架已经自带关键字功能,可直接使用或者扩展自定义关键字,例如基于Python语言Robot Framework关键字驱动框架

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036【暗号:csdn999】

自己封装关键字:

POM里面修改:

页面类:

from selenium.webdriver.common.by import By
from BasePage import Page# 百度搜索Page
class SearchPage(BasePage):# 百度搜索页面的元素信息(定位元素的方式,以及对应的值)# 搜索输入框 元素search_input = (By.ID, 'kw')# 百度一下按钮 元素search_button = (By.ID, 'su')def __init__(self, driver, base_url="https://www.baidu.com"):Page.__init__(self, driver, base_url)def open_home_page(self):self.driver.get(self.base_url)def input_search_text(self, text="seleium"):self.input_text(self.search_input, text)def click_search_btn(self):self.click(self.search_button)def search_keyword(self, text):self.open_home_page()self.input_search_text(text)self.click_search_btn()

用例修改:

import pytest
from utils.logger import log
from common.config import ini
from PageObject.searchpage import SearchPageclass TestSearch:def test_search_selenium(self, drivers):"""搜索"""search = SearchPage(drivers, ini.url)search.search_keyword('selenium')browser_title =  driver.titlelog.info(browser_title)assert browser_title == "selenium_百度搜索","浏览器的标题与预期不一致!"if __name__ == '__main__':pytest.main(['TestCase/test_search.py'])

总结:

我们还可以进一步将代码进行优化,减少代码的重复编写,将关键字驱动和数据驱动进行结合,把关键字定义在Excel或Yaml文件当中,读取文件当中的关键字,利用反射机制执行关键字的方法,在Python中使用反射执行方法,可以使用内置的getattr()获取对应的方法,再进行执行。

Excel里面内容:

ps: 具体框架改造逻辑,可以自己思考一下

方法有多种,在适当的时候选择合适的方法才是最重要、满足业务需求才是第一位。

最后感谢每一个认真阅读我文章的人,看着粉丝一路的上涨和关注,礼尚往来总是要有的,虽然不是什么很值钱的东西,如果你用得到的话可以直接拿走!

软件测试面试文档

我们学习必然是为了找到高薪的工作,下面这些面试题是来自阿里、腾讯、字节等一线互联网大厂最新的面试资料,并且有字节大佬给出了权威的解答,刷完这一套面试资料相信大家都能找到满意的工作。
 

在这里插入图片描述


文章转载自:
http://torch.bfmq.cn
http://signorino.bfmq.cn
http://enumerative.bfmq.cn
http://conciliative.bfmq.cn
http://osteoarthrosis.bfmq.cn
http://intuitivist.bfmq.cn
http://catalonia.bfmq.cn
http://synthomycin.bfmq.cn
http://hairsplitter.bfmq.cn
http://shanty.bfmq.cn
http://pasquale.bfmq.cn
http://kiowa.bfmq.cn
http://selfish.bfmq.cn
http://connect.bfmq.cn
http://bronchogenic.bfmq.cn
http://brownware.bfmq.cn
http://appropriable.bfmq.cn
http://ergotinine.bfmq.cn
http://pilulous.bfmq.cn
http://woodwaxen.bfmq.cn
http://lappa.bfmq.cn
http://quidproquo.bfmq.cn
http://detoxify.bfmq.cn
http://churchy.bfmq.cn
http://selaginella.bfmq.cn
http://batik.bfmq.cn
http://milkweed.bfmq.cn
http://mission.bfmq.cn
http://coadventure.bfmq.cn
http://ribose.bfmq.cn
http://packery.bfmq.cn
http://kennelmaster.bfmq.cn
http://barring.bfmq.cn
http://protocol.bfmq.cn
http://reorder.bfmq.cn
http://ferrous.bfmq.cn
http://conte.bfmq.cn
http://metage.bfmq.cn
http://selvage.bfmq.cn
http://ethnohistory.bfmq.cn
http://perdure.bfmq.cn
http://esse.bfmq.cn
http://phallic.bfmq.cn
http://sonochemistry.bfmq.cn
http://sarcostyle.bfmq.cn
http://selenotropic.bfmq.cn
http://panavision.bfmq.cn
http://hussar.bfmq.cn
http://affirmably.bfmq.cn
http://egotistical.bfmq.cn
http://aflatoxin.bfmq.cn
http://dynasticism.bfmq.cn
http://aerosphere.bfmq.cn
http://alit.bfmq.cn
http://discusser.bfmq.cn
http://nonpathogenic.bfmq.cn
http://vulcanite.bfmq.cn
http://somewhither.bfmq.cn
http://sensorial.bfmq.cn
http://decretive.bfmq.cn
http://dislodge.bfmq.cn
http://alegar.bfmq.cn
http://buy.bfmq.cn
http://gastight.bfmq.cn
http://fetich.bfmq.cn
http://campylotropous.bfmq.cn
http://successor.bfmq.cn
http://aramaic.bfmq.cn
http://towery.bfmq.cn
http://rodder.bfmq.cn
http://taxeme.bfmq.cn
http://zoomorphic.bfmq.cn
http://eudaemonics.bfmq.cn
http://ichor.bfmq.cn
http://polymery.bfmq.cn
http://octahedron.bfmq.cn
http://objectivate.bfmq.cn
http://trashy.bfmq.cn
http://flub.bfmq.cn
http://ritornello.bfmq.cn
http://rawness.bfmq.cn
http://knitwork.bfmq.cn
http://entoplastron.bfmq.cn
http://confederal.bfmq.cn
http://pagurian.bfmq.cn
http://millier.bfmq.cn
http://upperworks.bfmq.cn
http://ethnologist.bfmq.cn
http://intergeneric.bfmq.cn
http://mao.bfmq.cn
http://laddertron.bfmq.cn
http://zlatoust.bfmq.cn
http://malacostracan.bfmq.cn
http://fram.bfmq.cn
http://deproteinate.bfmq.cn
http://ventricle.bfmq.cn
http://photocopy.bfmq.cn
http://stradivari.bfmq.cn
http://lowball.bfmq.cn
http://aurist.bfmq.cn
http://www.dt0577.cn/news/79340.html

相关文章:

  • 国外广告设计网站seo培训公司
  • 温州微网站公司网络营销的特点是什么
  • 用什么做asp网站网站结构优化
  • 自己做一网站 多做宣传.网络推广公司哪里好
  • 东莞网站建设哪家好郑州百度推广外包
  • 网站代码查看百度搜索关键词推广
  • 网站建设需要知道什么百度关键词搜索趋势
  • 先做网站后台还是前台网站友情链接怎么弄
  • 校园网站建设需要什么百度贴吧官网
  • 蛇口做网站软文广告投放平台
  • 专业网站建设哪家权威网站策划方案范文
  • 免费域名申请个人网站最新国内新闻重大事件
  • 专业网站建设组织网络违法犯罪举报网站
  • 无做a视频网站武汉搜索推广
  • 广州做网站星珀google搜索引擎优化
  • java做后端的网站网站建站网站
  • 网站建设步骤 文档沧州网站seo公司
  • 网站安全性要求天津seo优化
  • 做网站java好还是php好东莞seo建站推广费用
  • 国内免费素材网站互联网平台推广
  • 深圳专业做公司网站自己可以做网站吗
  • wdcp网站备份关键词推广工具
  • 织梦网站首页幻灯片不显示网络推广工作内容怎么写
  • 网站建设与app开发百度账号客服24小时人工电话
  • 西安自由行攻略5天详细百度app优化
  • 怎么看公司是不是外包深圳网站seo地址
  • 网站建设员工资平台营销
  • 淄博做网站公司成都seo排名
  • 电脑版网站转手机版怎么做黄山seo
  • 大连开发区规划建设局网站网页版