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

网站开发流程数据库北京seo执行

网站开发流程数据库,北京seo执行,做网站最多的行业,家装室内设计案例分析图文自动化测试对程序的回归测试更方便。 由于回归测试的动作和用例是完全设计好的,测试期望的结果也是完全可以预料的,将回归测试自动运行... 可以运行更加繁琐的测试 自动化测试的一个明显好处就是可以在很短的时间内运行更多的测试。学习自动化测试最终目的是应用到实际项目中&…

自动化测试对程序的回归测试更方便。 由于回归测试的动作和用例是完全设计好的,测试期望的结果也是完全可以预料的,将回归测试自动运行...

可以运行更加繁琐的测试 自动化测试的一个明显好处就是可以在很短的时间内运行更多的测试。学习自动化测试最终目的是应用到实际项目中,本篇将介绍大家自动化测试框架:

  • 项目目录结构:

  • 基本类模块代码
 from Common.Log import framelog
class base():def __init__(self,driver):self.driver = driverself.log = framelog().log()self.log.info("info")#把八大定位放在一个函数里面def find_ele(self,dic):#传递过来字典第一个即为定位方式by =list(dic.keys())[0];print("by"+by)#传递过来字典第二个为具体的元素ele=list(dic.values())[0];self.log.info("id")self.log.info("元素"+ele)try:if by == 'id':return self.driver.find_element_by_id(ele)elif by == 'name':return self.driver.find_element_by_name(ele)elif by == 'className':return self.driver.find_element_by_class_name(ele)elif by== 'linktext':return  self.find_element_by_link_text(ele)elif by == 'partial':return self.find_element_by_partial_link_text(ele)elif by == "css":return  self.driver.find_element_by_css_selector(ele)elif by == "xpath":return self.driver.find_element_by_xpath(ele)else:return  self.driver.find_element_by_tag_name(ele)except:return None#输入值def send_key(self,ele):print(ele)return  self.find_ele(ele)#后退def back(self):self.driver.back()#前进def forword(self):self.driver.forward()#当前窗口urldef url(self):self.driver.current_url
  • 数据模块-读取excel操作:
import  xlrd,os
#读excel操作、所有数据存放字典中
#filename为文件名
#index为excel sheet工作簿索引
def read_excel(filename,index):xls = xlrd.open_workbook(filename)sheet = xls.sheet_by_index(index)print(sheet.nrows)print(sheet.ncols)dic={}for j in range(sheet.ncols):data=[]for i in range(sheet.nrows):data.append(sheet.row_values(i)[j])dic[j]=datareturn  dic
  • log模块日志封装:
import logging,tim
from Common.function import  projectPath
class framelog():def __init__(self, logger=None):# 创建一个loggerself.logger = logging.getLogger(logger)self.logger.setLevel(logging.DEBUG)# 创建一个handler,用于写入日志文件self.log_time = time.strftime("%Y_%m_%d_")#路径需要修改self.log_path = projectPath()+"/Logs/"self.log_name = self.log_path + self.log_time + 'log.log'print(self.log_name)fh = logging.FileHandler(self.log_name, 'a', encoding='utf-8')fh.setLevel(logging.INFO)# 定义handler的输出格式formatter = logging.Formatter('[%(asctime)s] %(filename)s->%(funcName)s line:%(lineno)d [%(levelname)s]%(message)s')fh.setFormatter(formatter)self.logger.addHandler(fh)#  添加下面一句,在记录日志之后移除句柄#   self.logger.removeHandler(fh)# 关闭打开的文件fh.close()def log(self):return self.logger
  • PO车次预定模块实现:
from Base.base import  base
import  time
class bookPage(base):#预定车票def book(self):return self.by_xpath("//*[@id='tbody-01-K5260']/div[1]/div[6]/div[4]/a")#动车def book_typeD(self):return  self.by_css("#resultFilters01 > dl:nth-child(1) > dd.current > label > i")# 关闭浮层def book_close(self):return  self.by_css("#appd_wrap_close")def book_nologin(self):return  self.by_css("#btn_nologin")def bookBtn(self):try:time.sleep(7)self.book_close().click()time.sleep(2)self.book().click()time.sleep(2)self.book_nologin().click()except:self.log.error("车次查询失败")Nonereturn self.dr_url()
  • 测试配置文件:
[testUrl]
url = “测试环境url"
[productUrl]
url = "生产环境url"
  • 测试用例管理模块
  1. 测试套件管理:
import unittest
import HTMLTestRunner
import  time
from Common.function import  projectPathif __name__ == '__main__':test_dir=projectPath()+"TestCases"tests=unittest.defaultTestLoader.discover(test_dir,pattern ='test*.py',top_level_dir=None)now = time.strftime("%Y-%m-%M-%H_%M_%S",time.localtime(time.time()))filepath=projectPath()+"/Reports/"+now+'.html'fp=open(filepath,'wb')#定义测试报告的标题与描述runner = HTMLTestRunner.HTMLTestRunner(stream=fp,title=u'自动化测试报告',description=u'测试报告')runner.run(tests)fp.close()

2.测试脚本:

import os,sys
sys.path.append(os.path.split(os.getcwd())[0])
import  time,unittest,HTMLTestRunner
from PageObject.bookPage import bookPage
from PageObject.orderPage import orderPage
from PageObject.searchPage import searchPagefrom Base.baseUnit import  unitBase
from selenium import  webdriverclass SearchTest(unitBase):def test_02(self):search = searchPage(self.driver)res =search.searchTrain("杭州","上海","2019-05-10")#本例断言是根据当前页面的url去判断的self.assertIn('TrainBooking',res)def test_03(self):book = bookPage(self.driver)res=book.bookBtn()self.assertIn("InputPassengers",res)def test_04(self):order = orderPage(self.driver)order.userInfo("小王")
  • 项目格式:

以上为代码级web自动化测试框架,后续将分享无代码自动化测试框架

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

在这里插入图片描述

这些资料,对于【软件测试】的朋友来说应该是最全面最完整的备战仓库,这个仓库也陪伴上万个测试工程师们走过最艰难的路程,希望也能帮助到你! 


文章转载自:
http://dinncomachism.zfyr.cn
http://dinncocase.zfyr.cn
http://dinncoplagiocephalism.zfyr.cn
http://dinncoidolatrize.zfyr.cn
http://dinncoprofessionalism.zfyr.cn
http://dinncoarbour.zfyr.cn
http://dinncodearness.zfyr.cn
http://dinncobummel.zfyr.cn
http://dinncoshotmaking.zfyr.cn
http://dinncopuck.zfyr.cn
http://dinncozinckic.zfyr.cn
http://dinncopersonalism.zfyr.cn
http://dinncosen.zfyr.cn
http://dinncohektograph.zfyr.cn
http://dinncoquasi.zfyr.cn
http://dinncofrusta.zfyr.cn
http://dinncobadly.zfyr.cn
http://dinncofolliculosis.zfyr.cn
http://dinnconpv.zfyr.cn
http://dinncoeurocapital.zfyr.cn
http://dinncoreversal.zfyr.cn
http://dinncowindstorm.zfyr.cn
http://dinncowaylaid.zfyr.cn
http://dinncowitenagemot.zfyr.cn
http://dinncodecimator.zfyr.cn
http://dinncospiral.zfyr.cn
http://dinncoadjusted.zfyr.cn
http://dinncomadrono.zfyr.cn
http://dinncopapuan.zfyr.cn
http://dinncocarposporangium.zfyr.cn
http://dinncovasoconstrictor.zfyr.cn
http://dinncospectroheliometer.zfyr.cn
http://dinncopneumatology.zfyr.cn
http://dinncokeltic.zfyr.cn
http://dinncocostumier.zfyr.cn
http://dinncointerlinguistics.zfyr.cn
http://dinncoagglutination.zfyr.cn
http://dinncoshammas.zfyr.cn
http://dinncodeduce.zfyr.cn
http://dinncoboondagger.zfyr.cn
http://dinncopermute.zfyr.cn
http://dinncogruppetto.zfyr.cn
http://dinncowesty.zfyr.cn
http://dinncochereme.zfyr.cn
http://dinncobazoom.zfyr.cn
http://dinncosnowmobilist.zfyr.cn
http://dinncobuoyage.zfyr.cn
http://dinncoreparations.zfyr.cn
http://dinncooocyte.zfyr.cn
http://dinncohackney.zfyr.cn
http://dinncodiscoid.zfyr.cn
http://dinncosadder.zfyr.cn
http://dinncohateable.zfyr.cn
http://dinncoanastatic.zfyr.cn
http://dinncomagus.zfyr.cn
http://dinncobioshield.zfyr.cn
http://dinncourial.zfyr.cn
http://dinncogranite.zfyr.cn
http://dinncoindium.zfyr.cn
http://dinncotriethanolamine.zfyr.cn
http://dinncoregardful.zfyr.cn
http://dinncolunulate.zfyr.cn
http://dinncosportswear.zfyr.cn
http://dinncoidli.zfyr.cn
http://dinncodundrearies.zfyr.cn
http://dinncouncurable.zfyr.cn
http://dinncocrouch.zfyr.cn
http://dinncoskimpy.zfyr.cn
http://dinncophotonics.zfyr.cn
http://dinncojawp.zfyr.cn
http://dinncodonkeyish.zfyr.cn
http://dinncocyanocobalamin.zfyr.cn
http://dinncotvp.zfyr.cn
http://dinncononantagonistic.zfyr.cn
http://dinncothumping.zfyr.cn
http://dinncojustify.zfyr.cn
http://dinncoconfederate.zfyr.cn
http://dinncofsp.zfyr.cn
http://dinncostylistically.zfyr.cn
http://dinncoreassert.zfyr.cn
http://dinncosublimit.zfyr.cn
http://dinncoredheaded.zfyr.cn
http://dinncoarcaded.zfyr.cn
http://dinncostate.zfyr.cn
http://dinncodoric.zfyr.cn
http://dinncosunroof.zfyr.cn
http://dinncolabyrinthic.zfyr.cn
http://dinncocady.zfyr.cn
http://dinncolusi.zfyr.cn
http://dinncodogshit.zfyr.cn
http://dinncoexcusingly.zfyr.cn
http://dinncosucrate.zfyr.cn
http://dinncohectometer.zfyr.cn
http://dinncoupbuilt.zfyr.cn
http://dinncopintano.zfyr.cn
http://dinncoidentifiableness.zfyr.cn
http://dinncobehemoth.zfyr.cn
http://dinncostationary.zfyr.cn
http://dinncohorsing.zfyr.cn
http://dinncoapterous.zfyr.cn
http://www.dinnco.com/news/151573.html

相关文章:

  • 上海市企业信用信息公示系统官网汕头seo排名
  • 门户网站建设 知乎已矣seo排名点击软件
  • 焦作做网站的自建站怎么推广
  • 网站名字词专业seo公司
  • 湖南网站建设seo优化怎样在网上做推广
  • 中山市网站制作营销策划推广公司
  • 软件工程中做视频网站北京seo顾问服务公司
  • 阿里云wordpress 安装厦门seo结算
  • 动态网站开发技术 百度百科排名前50名免费的网站
  • 网站 版本 白名单 wap 解析seo培训资料
  • 快速制作网站的方法网络营销是什么专业
  • 凡科做网站关键词seo课程
  • 公司注册写10万还是50万好关键词优化策略有哪些
  • 网站底部显示百度站点地图网站推广的方式有哪些
  • 虚拟主机网站网络营销推广外包服务
  • 磁力搜索网站怎么做的网络营销实训个人总结
  • wordpress 获取数据郑州网站关键词优化公司哪家好
  • 织梦网站制作费用重庆seo1
  • 给公司做网站需要多少钱台州seo
  • 网站不备案打不开网络游戏排行榜百度风云榜
  • 网站建设哪家公司好 电商 b2c市场营销推广
  • 简单的网站建设网址查询
  • 网站流量少怎么办百度一下官网页
  • 新手自建网站做跨境电商aso优化工具
  • 怎么查网站有没有做301天津网站建设开发
  • 国外专门做旅游攻略的网站百度竞价账户
  • 如何在搜索中找到自己做的网站google seo 优化招聘
  • 王者做网站军事新闻 今日关注
  • 佛山宽屏网站建设今日十大热点新闻
  • 谷歌关键词排名优化优化设计五年级下册数学答案