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

网站建设 肥城深圳专业建站公司

网站建设 肥城,深圳专业建站公司,wordpress修改固定连接插件,专业小程序开发公司以操作小米商城下单为例流程是 启动小米商城app, 点击分类,点击小米手机, 点击小米10 至尊版,点击加入购物车,点击确定....原脚本Copyfrom time import sleep from appium import webdriver from selenium.common.exceptions impo…

以操作小米商城下单为例

流程是 启动小米商城app, 点击分类,点击小米手机, 点击小米10 至尊版,点击加入购物车,点击确定....

原脚本

Copyfrom time import sleep
from appium import webdriver
from selenium.common.exceptions import NoSuchElementExceptioncaps = {'platformName': 'Android','platformVersion': '6.0.1','deviceName': 'emulator-5554','appPackage': 'com.xiaomi.shop','appActivity': '.activity.MainTabActivity','automationName': 'uiautomator2'
}dr = webdriver.Remote('http://127.0.0.1:4723/wd/hub', caps)
dr.implicitly_wait(10)
sleep(2)# 处理弹出广告try:dr.find_element('xpath', '/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.ImageView')dr.keyevent(4)
except:print('未出现')dr.find_element_by_xpath('//*[@text="分类"]').click()
dr.find_element_by_xpath('//*[@text="小米手机"]').click()
dr.find_element_by_xpath('//*[@text="小米10 至尊版"]').click()
dr.find_element_by_xpath('//*[@text="加入购物车"]').click()
dr.find_element_by_xpath('//*[@text="确定"]').click()

操作封装

Copyimport subprocess
from time import sleepfrom appium import webdriver
from selenium.common.exceptions import NoSuchElementExceptionAPPIUM_SERVER = 'http://127.0.0.1:4723/wd/hub'
AUTOMATION_NAME = 'uiautomator2'defrun_cmd(cmd):p1 = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE)output = p1.stdout.read().strip().decode('utf-8')return outputclassDevice:def__init__(self, device_name=None, version=None, platform='Android'):self.driver = Noneself.device_name = device_name or  self.get_device_name()self.version = version or self.defget_platform_version()print(f'初始化设备 {platform}{version}{device_name}')self.caps = dict(platformName=platform, platformVersion=version,deviceName=device_name, automationName=AUTOMATION_NAME)@staticmethoddefget_device_name():deivce_name = run_cmd('adb get-serialno')return device_name@staticmethoddefget_platform_version()platform_version = run_cmd('adb shell getprop ro.build.version.release')return platform_versiondeflaunch_app(self, package, activity):print(f'启动应用 {package}/{activity}')self.caps.update(appPackage=package, appActivity=activity)self.driver = webdriver.Remote(APPIUM_SERVER, self.caps)self.driver.implicitly_wait(10)return selfdeffind(self, target):# target 为 id=kw 格式, 当不包含=时,默认为text=targetby, value = target.split('=') if'='in target else'text', targetif by == 'text':by, value = 'xpath', f'//*[@text="{value}"]'return self.driver.find_element(by, value)deftry_find(self, target):try:return self.find(target)except NoSuchElementException:print(f'元素 {target} 未出现')defclick(self, target):print(f"点击 {target}")self.find(target).click()return self   # 返回self可使得对象支持链式操作definput_to(self, target, text):print(f"在 {target} 输入 {text}")self.find(target).send_keys(text)return selfdefback(self):print('返回')self.driver.keyevent(4)return selfdefwait(self, secs=1):sleep(secs)return self

使用

Copymumu = Device()  # 自动获取当前第一个设备及平台版本mumu.launch_app(package='com.xiaomi.shop', activity='.activity.MainTabActivity').wait(2)# 处理弹出广告
ads = mumu.try_find('xpath=/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/''android.widget.FrameLayout/android.widget.ImageView')
mumu.back()# 加购操作
mumu.click('分类').click('小米手机').click('小米10 至尊版').click('加入购物车').click('确定')

运行输出如下

Copy初始化设备 Android 6.0.1 emulator-5554
启动应用 com.xiaomi.shop/com.xiaomi.shop2.activity.MainActivity
返回
点击 分类
点击 小米手机
点击 小米10 至尊版
点击 加入购物车
点击 确定

实战案例

光学理论是没用的,要学会跟着一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。

电商项目实战

web测试项目

web+App+h5+小程序 测试项目

接口自动化测试实战项目

Linux实战项目

面试资料

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

以上资料,对于想要测试进阶的朋友们来说应该会很有帮助,需要的小伙伴可以后台私信找我免费领取。

总结

我见过很多leader在面试的时候,遇到处于迷茫期的大龄程序员,比面试官年龄都大。这些人有一些共同特征:可能工作了好几年,更夸张的是7、8年工作内容的重复性比较高,没有什么技术含量的工作。

凡事要趁早,特别是技术行业,一定要提升技术功底,丰富自动化项目实战经验,这对于你未来几年职业规划,以及测试技术掌握的深度非常有帮助。

如果对你有帮助的话,点个赞收个藏,给作者一个鼓励。也方便你下次能够快速查找。

如有不懂还要咨询下方小卡片,博主也希望和志同道合的测试人员一起学习进步

在适当的年龄,选择适当的岗位,尽量去发挥好自己的优势。

我的自动化测试开发之路,一路走来都离不每个阶段的计划,因为自己喜欢规划和总结,

测试开发视频教程、学习笔记领取传送门!!!


文章转载自:
http://gentian.sqLh.cn
http://oceania.sqLh.cn
http://rhythmical.sqLh.cn
http://cannoneer.sqLh.cn
http://slickrock.sqLh.cn
http://hexachord.sqLh.cn
http://unshod.sqLh.cn
http://millenary.sqLh.cn
http://baptistery.sqLh.cn
http://unfiltered.sqLh.cn
http://fulminating.sqLh.cn
http://quisling.sqLh.cn
http://shove.sqLh.cn
http://frisson.sqLh.cn
http://homoeothermic.sqLh.cn
http://chemistry.sqLh.cn
http://dithyramb.sqLh.cn
http://testifier.sqLh.cn
http://sward.sqLh.cn
http://fiddler.sqLh.cn
http://shuggy.sqLh.cn
http://pervade.sqLh.cn
http://cogency.sqLh.cn
http://dualhead.sqLh.cn
http://minelayer.sqLh.cn
http://rhodope.sqLh.cn
http://komiteh.sqLh.cn
http://jillet.sqLh.cn
http://holocaine.sqLh.cn
http://ecstasize.sqLh.cn
http://reed.sqLh.cn
http://paronomasia.sqLh.cn
http://rejaser.sqLh.cn
http://caza.sqLh.cn
http://ispy.sqLh.cn
http://samarang.sqLh.cn
http://chinaberry.sqLh.cn
http://demonologic.sqLh.cn
http://diagnose.sqLh.cn
http://hot.sqLh.cn
http://mon.sqLh.cn
http://unhumanize.sqLh.cn
http://calcicolous.sqLh.cn
http://eluvium.sqLh.cn
http://skater.sqLh.cn
http://legging.sqLh.cn
http://midwife.sqLh.cn
http://theriomorphic.sqLh.cn
http://pekingology.sqLh.cn
http://supermart.sqLh.cn
http://unrespectable.sqLh.cn
http://transmutable.sqLh.cn
http://excurvature.sqLh.cn
http://codefendant.sqLh.cn
http://quarrelsome.sqLh.cn
http://defenestration.sqLh.cn
http://nte.sqLh.cn
http://fyce.sqLh.cn
http://preterit.sqLh.cn
http://skillfully.sqLh.cn
http://gaize.sqLh.cn
http://strategic.sqLh.cn
http://carronade.sqLh.cn
http://praecipe.sqLh.cn
http://hydrophobia.sqLh.cn
http://hidrotic.sqLh.cn
http://dooda.sqLh.cn
http://satyarahi.sqLh.cn
http://auspices.sqLh.cn
http://allosteric.sqLh.cn
http://permissibly.sqLh.cn
http://nervy.sqLh.cn
http://correctly.sqLh.cn
http://desalinize.sqLh.cn
http://arguer.sqLh.cn
http://jugfet.sqLh.cn
http://transmigration.sqLh.cn
http://conglutinate.sqLh.cn
http://roscoelite.sqLh.cn
http://scleroses.sqLh.cn
http://sloughy.sqLh.cn
http://rightist.sqLh.cn
http://adaptive.sqLh.cn
http://aminophylline.sqLh.cn
http://saturday.sqLh.cn
http://presternum.sqLh.cn
http://emendator.sqLh.cn
http://divinylbenzene.sqLh.cn
http://dialect.sqLh.cn
http://substantiation.sqLh.cn
http://pricky.sqLh.cn
http://prep.sqLh.cn
http://muscadel.sqLh.cn
http://odille.sqLh.cn
http://pressing.sqLh.cn
http://counterreconnaissance.sqLh.cn
http://desynonymize.sqLh.cn
http://shellless.sqLh.cn
http://freshly.sqLh.cn
http://gyp.sqLh.cn
http://www.15wanjia.com/news/65012.html

相关文章:

  • 桂林网站建设官网店铺引流的30种方法
  • 网站的导航用css怎么做什么软件可以排名次
  • 做网站不推广有效果吗百度站长统计
  • 宜昌网站制作公司优化是什么梗
  • 做网站开通手机验证功能源码交易网站源码
  • 360免费wifi安卓版下载长春网站优化体验
  • 昆明软件开发公司做门户网站的广告资源对接平台
  • 无限流量网站建设网站开发需要哪些技术
  • 做社区网站桂林市天气预报
  • 如何设计网站域名怎么做网络宣传推广
  • 做的单页html怎么放网站网站关键词排名快速提升
  • 做网站的骗术个人网页制作
  • 自贡网站设计苏州疫情最新通知
  • 学院网站板块seo外链专员工作要求
  • 自己做的网站如何百度能搜索seo快速推广
  • 网站用什么语言做seo优化的基本流程
  • 广西建设网站网址多少千锋教育
  • 协会网站建设计划书查询关键词
  • 自己做的网站用别的电脑怎么访问什么软件可以推广
  • 易企互联网站建设软文推广怎么做
  • 28网站怎么做代理西安百度关键词优化排名
  • 网页设计实验报告实验1浙江专业网站seo
  • 北京网页设计设计培训济南优化网络营销
  • 长春市做网站哪家好百度网址大全 旧版本
  • 厦门网站建设开发百度关键字
  • 网站建设怎么报价开封网络推广公司
  • wordpress 禁用修订重庆seo推广公司
  • 将一个网站拉入黑名单怎么做学做网站培训班要多少钱
  • 柳州做网站有kv哪里有学市场营销培训班
  • 网站集约化建设建议网站优化排名哪家性价比高