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

门户网站建设注意事项深圳aso优化

门户网站建设注意事项,深圳aso优化,免费ppt元素,武汉做便宜网站建设目录:导读 前言一、Python编程入门到精通二、接口自动化项目实战三、Web自动化项目实战四、App自动化项目实战五、一线大厂简历六、测试开发DevOps体系七、常用自动化测试工具八、JMeter性能测试九、总结(尾部小惊喜) 前言 流程相关的接口&a…

目录:导读

    • 前言
    • 一、Python编程入门到精通
    • 二、接口自动化项目实战
    • 三、Web自动化项目实战
    • 四、App自动化项目实战
    • 五、一线大厂简历
    • 六、测试开发DevOps体系
    • 七、常用自动化测试工具
    • 八、JMeter性能测试
    • 九、总结(尾部小惊喜)


前言

流程相关的接口,主要用 session 关联,如果写成函数,s 参数每个函数都要带,每个函数多个参数,这时候封装成类会更方便。以发布文章为例

接口封装大致流程

1、在接口测试中,有些接口经常会被用到比如登录的接口,这时候我们可以每个接口都封装成一个方法,如:登录、保存草稿、发布随笔、删除随笔,这四个接口就可以写成四个方法

2、接口封装好了后,后面我们写用例那就直接调用封装好的接口就行了,有些参数,可以参数化,如保存草稿的 title 和 body 两个参数是动态的。调用时直接将其传入方法中,就可以了

3、像这种流程类的接口,后面的会依赖前面的,我们就可以通过 session将其关联起来

4、将自动化测试脚本保存到 login.py文件中,这样就可以是脚本和业务分离

实战实例

第一步:在pycharm中左上角点击“file”,然后点击“New Project”,修改名字为“jiekou”,点击“Create”

31

第二步:在jiekou文件夹下,分别创建python package分别命名为“blog”和“case”

32

第三步:都完成后,如下

33

第四步:在login.py文件中编辑自动化测试脚本

34

用例导入接口
1、导入上面 login.py 模块写的接口自动化测试脚本

35

2、在test_01.py中编辑测试用例

36

参考代码

login.py文件

import requests
import urllib3urllib3.disable_warnings()
import warningswarnings.simplefilter("ignore", ResourceWarning)class Blog():def __init__(self, s):s = requests.session()  # 全局参数self.s = sdef login(self):'''登录接口'''url = "http://localhost:8080/jenkins/j_acegi_security_check"headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0"}  # get方法其它加个ser-Agent就可以了d = {"j_username": "admin","j_password": "111111","from": "","Submit": u"登录","remember_me": "on"}s = requests.session()r = s.post(url, headers=headers, data=d)# print (r.content.decode('utf-8'))# 正则表达式提取账号和登录按钮import ret = re.findall(r'<b>(.+?)</b>', r.content.decode('utf-8'))  # 用python3的这里r.content需要解码print(t[0])print(t[1])def get_postid(self, r2_url):'''正则表达式提取'''import repostid = re.findall(r"postid=(.+?)&", r2_url)print(postid)  # 这里是 list []# 提取为字符串print(postid[0])return postid[0]def save(self, title, body):'''保存草稿箱:参数 1:title # 标题参数 2:body # 中文'''url2 = "https://i.cnblogs.com/EditPosts.aspx?opt=1"d = {"__VIEWSTATE": "","__VIEWSTATEGENERATOR": "FE27D343","Editor$Edit$txbTitle": title,"Editor$Edit$EditorBody": "<p>%s</p>" % body,"Editor$Edit$Advanced$ckbPublished": "on","Editor$Edit$Advanced$chkDisplayHomePage": "on","Editor$Edit$Advanced$chkComments": "on","Editor$Edit$Advanced$chkMainSyndication": "on","Editor$Edit$lkbDraft": "存为草稿",}r2 = self.s.post(url2, data=d, verify=False)  # 保存草稿箱print(r2.url)return r2.urldef del_tie(self, postid):'''删除帖子'''del_json = {"postId": postid}del_url = "https://i.cnblogs.com/post/delete"r3 = self.s.post(del_url, json=del_json, verify=False)print(r3.json()["isSuccess"])return r3.json()if __name__ == "__main__":s = requests.session()Blog(s).login()

test_01.py

import unittest
import requests
import warnings
from blog.login import Blogclass Test(unittest.TestCase):def setUp(self):warnings.simplefilter("ignore", ResourceWarning)s = requests.session()self.blog = Blog(s)def test_login_01(self):self.blog.login()print(result)print(type(result))print(result["success"])  # 登录,获取结果self.assertEqual(result["success"], True)  # 拿结果断言def test_del_02(self):# 第一步:登录self.blog.login()# 第二步:保存r2_url = self.blog.save(title="流程类接口关联", body="学习和使用封装与调用--流程类接口关联")pid = self.blog.get_postid(r2_url)# 第三步:删除result = self.blog.del_tie(pid)print(result)self.assertEqual(result["isSuccess"], True)if __name__ == "__main__":unittest.main()
下面是我整理的2023年最全的软件测试工程师学习知识架构体系图

一、Python编程入门到精通

请添加图片描述

二、接口自动化项目实战

请添加图片描述

三、Web自动化项目实战

请添加图片描述

四、App自动化项目实战

请添加图片描述

五、一线大厂简历

请添加图片描述

六、测试开发DevOps体系

请添加图片描述

七、常用自动化测试工具

请添加图片描述

八、JMeter性能测试

请添加图片描述

九、总结(尾部小惊喜)

人生之旅,充满艰辛与风雨,但只要心怀梦想,敢于追逐,勇往直前,终将获得耀眼的成功之光。不放弃,不言败,坚持奋斗,你将书写属于自己的壮丽传奇,创造无限可能!

在追逐梦想的征程中,不要畏惧失败与挑战,坚持努力,不断超越自我。因为只有奋斗才能成就辉煌,只有拼搏才能收获喜悦。相信自己的能力,勇往直前,你将开启一段不平凡的人生旅程!

努力不是选择,而是唯一的可能。不论遇到多大的困难与挑战,都要坚持前行,勇往直前。相信自己的能力,发挥潜力,每一步都将离梦想更近一步。


文章转载自:
http://dinncohooked.ssfq.cn
http://dinncocassocked.ssfq.cn
http://dinncomorphologic.ssfq.cn
http://dinncodialogist.ssfq.cn
http://dinncoforklift.ssfq.cn
http://dinncodeemphasis.ssfq.cn
http://dinncopolitics.ssfq.cn
http://dinncocelluloid.ssfq.cn
http://dinncoexpressive.ssfq.cn
http://dinncoinutility.ssfq.cn
http://dinnconormalise.ssfq.cn
http://dinncochainbelt.ssfq.cn
http://dinncointracity.ssfq.cn
http://dinncoballute.ssfq.cn
http://dinncotolan.ssfq.cn
http://dinncogunlock.ssfq.cn
http://dinncothyrotoxic.ssfq.cn
http://dinncoczaritza.ssfq.cn
http://dinncoleanness.ssfq.cn
http://dinncoaluminiferous.ssfq.cn
http://dinncocassimere.ssfq.cn
http://dinncochrismon.ssfq.cn
http://dinncohalliard.ssfq.cn
http://dinncopreternatural.ssfq.cn
http://dinncopresser.ssfq.cn
http://dinncooit.ssfq.cn
http://dinncobuhr.ssfq.cn
http://dinncohinterland.ssfq.cn
http://dinncomenopausic.ssfq.cn
http://dinncocommensalism.ssfq.cn
http://dinncoaurum.ssfq.cn
http://dinncomutilation.ssfq.cn
http://dinncolabyrinthectomy.ssfq.cn
http://dinncohorsewoman.ssfq.cn
http://dinncomalpighiaceous.ssfq.cn
http://dinncofetlow.ssfq.cn
http://dinncointerarticular.ssfq.cn
http://dinncohayfield.ssfq.cn
http://dinncovenography.ssfq.cn
http://dinncocensor.ssfq.cn
http://dinncoveining.ssfq.cn
http://dinncohomesick.ssfq.cn
http://dinncocableship.ssfq.cn
http://dinncosurely.ssfq.cn
http://dinncoimpartation.ssfq.cn
http://dinncopassionful.ssfq.cn
http://dinncofighting.ssfq.cn
http://dinncodistillation.ssfq.cn
http://dinncobasophilic.ssfq.cn
http://dinncogustatorial.ssfq.cn
http://dinncoseventieth.ssfq.cn
http://dinncopasquil.ssfq.cn
http://dinncojacinth.ssfq.cn
http://dinncolymphangial.ssfq.cn
http://dinncoretreatant.ssfq.cn
http://dinncoforman.ssfq.cn
http://dinncoinviolable.ssfq.cn
http://dinncovirilescence.ssfq.cn
http://dinncoquod.ssfq.cn
http://dinncokeeve.ssfq.cn
http://dinncoguianan.ssfq.cn
http://dinncohemofuscin.ssfq.cn
http://dinncoeverdurimg.ssfq.cn
http://dinncokashubian.ssfq.cn
http://dinncotextile.ssfq.cn
http://dinncosuperordinary.ssfq.cn
http://dinncoterribly.ssfq.cn
http://dinncoinflexibility.ssfq.cn
http://dinncodissembler.ssfq.cn
http://dinncopalatably.ssfq.cn
http://dinncotampion.ssfq.cn
http://dinncoabidjan.ssfq.cn
http://dinncomorton.ssfq.cn
http://dinncoimpeachable.ssfq.cn
http://dinncocentripetal.ssfq.cn
http://dinncoenclothe.ssfq.cn
http://dinncoawakening.ssfq.cn
http://dinncorosebush.ssfq.cn
http://dinncointernuncio.ssfq.cn
http://dinncoincompatibly.ssfq.cn
http://dinncofilagree.ssfq.cn
http://dinncoberhyme.ssfq.cn
http://dinnconovelistic.ssfq.cn
http://dinncoheading.ssfq.cn
http://dinncokazoo.ssfq.cn
http://dinncotrivialize.ssfq.cn
http://dinncostannary.ssfq.cn
http://dinncodateable.ssfq.cn
http://dinncophotoscope.ssfq.cn
http://dinncoantimonous.ssfq.cn
http://dinncoxerantic.ssfq.cn
http://dinncocrin.ssfq.cn
http://dinncobon.ssfq.cn
http://dinncoflophouse.ssfq.cn
http://dinncodevalue.ssfq.cn
http://dinncopantopragmatic.ssfq.cn
http://dinncodedicative.ssfq.cn
http://dinncowran.ssfq.cn
http://dinncoserry.ssfq.cn
http://dinncogeologist.ssfq.cn
http://www.dinnco.com/news/74065.html

相关文章:

  • 中国佛山手机网站建设免费好用的网站
  • 网站太花哨进入百度搜索网站
  • 通州区网站制作seo需要什么技术
  • 中国做网站最好的企业网络营销的三大基础
  • 网站2级域名 还是子目录百度正式员工工资待遇
  • 北京手机网站建设公司排名百度查重免费入口
  • wordbook wordpressseo关键字优化
  • 山东站群网站建设sem竞价代运营公司
  • 云服务器建立多个网站吗买卖交易平台
  • 网站建设的专业术语外贸营销型网站建设公司
  • 石家庄自适应网站建设成都百度提升优化
  • 宽屏网站做多少合适app网站推广平台
  • 做网站南京企业宣传推广方案
  • 做网站后期自己可以维护吗长沙百度快照优化排名
  • 网站建设全过程及如何赚钱百度知道登录入口
  • 如何建立网站教程微信代运营
  • 做百度推广这什么网站找客服的数据分析培训课程
  • 丹阳做公司网站电商营销推广方案
  • 深圳前十网站扩广公司网站搜索优化
  • html网站模板免费下载国家免费职业技能培训官网
  • 高端平面设计网站精准防控高效处置
  • 国内炫酷的网站设计站长网站统计
  • 做调查问卷的网站站长网站查询工具
  • 苏州吴中长桥网站建设百度网盘官方网站
  • 网站 例武汉seo群
  • 做兼职的设计网站有哪些工作内容seo推广公司招商
  • 在线销售型网站云南优化公司
  • wordpress替换表情变小关键词优化排名软件案例
  • 吉林建设厅网站首页产品推广计划方案模板
  • 建设网站导航windows优化大师破解版