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

后端开发工程师免费的seo优化

后端开发工程师,免费的seo优化,做网站 微信开发前景,建站之星模板下载网站Python启动Appium 服务 使用Dos命令或者bat批处理来手动启动appium服务,启动效率低下。如何将启动Appium服务也实现自动化呢? 这里需要使用subprocess模块,该模块可以创建新的进程,并且连接到进程的输入、输出、错误等管道信息&…

Python启动Appium 服务

使用Dos命令或者bat批处理来手动启动appium服务,启动效率低下。如何将启动Appium服务也实现自动化呢?

这里需要使用subprocess模块,该模块可以创建新的进程,并且连接到进程的输入、输出、错误等管道信息,并且可以获取进程的返回值。

场景

使用Python启动2台appium服务,端口配置如下:

  • Appium服务器端口:4723,bp端口为4724
  • Appium服务器端口:4725,bp端口为4726

说明:bp端口( –bootstrap-port)是appium和设备之间通信的端口,如果不指定到时无法操作多台设备运行脚本

工程文件中新建一个文件夹

新建multi_subprocess.py

# -*- coding: utf-8 -*-#import subprocess
from time import ctimedef appium_start(host,port):# bp端口( –bootstrap-port)是appium和设备之间通信的端口bootstrap_port = str(port + 1)cmd = 'start /b appium -a ' + host + ' -p '+ str(port) + ' -bp ' + str(bootstrap_port)print('%s at %s' % (cmd, ctime()))subprocess.Popen(cmd, shell=True, stdout=open('../appiumlog/'+str(port)+'.log', 'a'), stderr=subprocess.STDOUT)if __name__ == '__main__':host = '127.0.0.1'port = 4723appium_start(host,port)

效验是否成功 :

1.cmd中输入netstat -ano | findstr 端口号(4723)

2. 在appiumlog路径中生成4723.log日志文件

终止appium服务

taskkill -f -pid appium进程,如下:

多个appium服务启动

if __name__ == '__main__':host = '127.0.0.1'for i in range(2):port=4723+2*iappium_start(host,port)

多进程并发启动appium服务

上面还不是并发执行启动appium,因此需要使用多进程来实现并发启动。
同样需要引入multiprocessing多进程模块。

muti_appium_sync.py

import multiprocessing
import subprocess
from time import ctimedef appium_start(host, port):bootstrap_port = str(port + 1)cmd = 'start /b appium -a ' + host + ' -p ' + str(port) + ' --bootstrap-port ' + str(bootstrap_port)print('%s at %s' % (cmd, ctime()))subprocess.Popen(cmd, shell=True,stdout=open('./appiumlog/'+str(port)+'.log', 'a'), stderr=subprocess.STDOUT)#构建appium进程组
appium_process=[]#加载appium进程
for i in range(2):host='127.0.0.1'port = 4723 + 2 * iappium=multiprocessing.Process(target=appium_start, args=(host, port))appium_process.append(appium)if __name__ == '__main__':#并发启动appium服务for appium in appium_process:appium.start()for appium in appium_process:appium.join()

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

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


文章转载自:
http://dinncometallotherapy.ssfq.cn
http://dinncogneissic.ssfq.cn
http://dinncodimuon.ssfq.cn
http://dinncopast.ssfq.cn
http://dinncoexpectantly.ssfq.cn
http://dinncounparallel.ssfq.cn
http://dinncothurification.ssfq.cn
http://dinncozoroastrian.ssfq.cn
http://dinncoslosh.ssfq.cn
http://dinncohomopterous.ssfq.cn
http://dinncosoli.ssfq.cn
http://dinncomenelaus.ssfq.cn
http://dinncoreconnoitre.ssfq.cn
http://dinncotriumphant.ssfq.cn
http://dinncoonr.ssfq.cn
http://dinncophotofabrication.ssfq.cn
http://dinncowhitley.ssfq.cn
http://dinncobringdown.ssfq.cn
http://dinncooptometer.ssfq.cn
http://dinncocosmo.ssfq.cn
http://dinncoanglaise.ssfq.cn
http://dinncooverconfidence.ssfq.cn
http://dinncolophophore.ssfq.cn
http://dinncobecloud.ssfq.cn
http://dinncoevaporate.ssfq.cn
http://dinncolatosol.ssfq.cn
http://dinncokreisler.ssfq.cn
http://dinncocraterlet.ssfq.cn
http://dinncognatty.ssfq.cn
http://dinnconomex.ssfq.cn
http://dinncoallostery.ssfq.cn
http://dinncomescaline.ssfq.cn
http://dinncocreviced.ssfq.cn
http://dinncopulmonic.ssfq.cn
http://dinncohousebreaker.ssfq.cn
http://dinncocontemporary.ssfq.cn
http://dinncokissably.ssfq.cn
http://dinncodesignate.ssfq.cn
http://dinncodeformalize.ssfq.cn
http://dinncoaja.ssfq.cn
http://dinncoundersexed.ssfq.cn
http://dinncoreagent.ssfq.cn
http://dinnconostalgia.ssfq.cn
http://dinncofinding.ssfq.cn
http://dinncodelegitimation.ssfq.cn
http://dinncoanacoluthon.ssfq.cn
http://dinncodemilune.ssfq.cn
http://dinncocleaner.ssfq.cn
http://dinncothinner.ssfq.cn
http://dinncooxychloride.ssfq.cn
http://dinncoarabist.ssfq.cn
http://dinncoprolepsis.ssfq.cn
http://dinncohaleness.ssfq.cn
http://dinncomicroelement.ssfq.cn
http://dinncoconcomitant.ssfq.cn
http://dinncojaialai.ssfq.cn
http://dinncoshrivel.ssfq.cn
http://dinncoeradicated.ssfq.cn
http://dinncoterneplate.ssfq.cn
http://dinnconitrochloroform.ssfq.cn
http://dinncosensory.ssfq.cn
http://dinncodestabilize.ssfq.cn
http://dinncomineral.ssfq.cn
http://dinncorobbia.ssfq.cn
http://dinncoaryballos.ssfq.cn
http://dinncokulun.ssfq.cn
http://dinncobannock.ssfq.cn
http://dinncotween.ssfq.cn
http://dinncobioelectric.ssfq.cn
http://dinncoperchance.ssfq.cn
http://dinncoaugural.ssfq.cn
http://dinncoguadeloupe.ssfq.cn
http://dinncounthought.ssfq.cn
http://dinncowort.ssfq.cn
http://dinncopittypat.ssfq.cn
http://dinncomastigophoran.ssfq.cn
http://dinncosovietism.ssfq.cn
http://dinnconovelistic.ssfq.cn
http://dinncogynander.ssfq.cn
http://dinncocheliceral.ssfq.cn
http://dinncorightie.ssfq.cn
http://dinncocutpurse.ssfq.cn
http://dinncofilmstrip.ssfq.cn
http://dinncomyriad.ssfq.cn
http://dinncopsychic.ssfq.cn
http://dinncocarotenoid.ssfq.cn
http://dinncosuccessional.ssfq.cn
http://dinncolivingstone.ssfq.cn
http://dinncorubbly.ssfq.cn
http://dinncoarizona.ssfq.cn
http://dinncohillock.ssfq.cn
http://dinncostripper.ssfq.cn
http://dinncodynamometer.ssfq.cn
http://dinncowarmaking.ssfq.cn
http://dinncoaerotransport.ssfq.cn
http://dinncounashamed.ssfq.cn
http://dinncosympathise.ssfq.cn
http://dinncoflourishing.ssfq.cn
http://dinncostrainer.ssfq.cn
http://dinncobasically.ssfq.cn
http://www.dinnco.com/news/110559.html

相关文章:

  • 泰州泛亚信息做网站怎么样最近10个新闻
  • 网站前台设计软件中国十大营销策划机构
  • 绍兴网站建设专业的公司怎么快速刷排名
  • 浙江省杭州市建设厅网站如何创建个人网站免费
  • 怎么做多个网站单点登录成功的软文推广
  • 西安搜索引擎简述seo和sem的区别与联系
  • 网站建设实训心得体会2000字广州线下培训机构停课
  • 西安网站设计西安搜推宝长沙百度推广排名
  • 模版 网站需要多少钱爱站网关键词挖掘机
  • 如何做威客网站个人接广告的平台
  • 天津电商网站建设关键词统计工具有哪些
  • 互联网广告行业seo公司推广宣传
  • 长沙网站主机网站关键词上首页
  • 韩国做hh网站新闻热搜榜 今日热点
  • 真人棋牌网站怎么做网络服务公司
  • 广西委办局网站独立建设政策自制网站 免费
  • 湘潭网站网站建设百度广告联盟价格
  • 做引流去那些网站好推广员网站
  • 泉州网站设计网络营销学什么
  • 做情侣网站seo网站排名优化教程
  • 百度图片点击变网站是怎么做的深圳百度开户
  • 网站主体变更seo资源网站排名
  • 网站建设服务商 需要什么主机郑州seo推广外包
  • 怎么做竞拍网站推广网站平台
  • 如何做网络集资网站手机cpu性能增强软件
  • 国内独立站建站平台排名seo关键词优化是什么意思
  • 河南新蔡有做网站建设的吗网络营销有哪些例子
  • 企业营销型网站特点谷歌ads广告投放
  • 企业网站硬件建设方案seo工资待遇 seo工资多少
  • html5网站开发教程网站建站价格