2022年ui自动化测试篇

以下记录的是,我在学习中的一些学习笔记,这篇笔记是自己学习的学习大杂烩,主要用于记录,方便查找

一、app自动化appium篇

##1、android【studio环境,adb命令】

##2、ios【xcode环境,命令行工具,wda相关】

命令行工具:【ios-deploy,ideviceinstaller,authroize-ios】

真机模拟器操作:https://daybreakx.cc/post/Mac%E4%B8%8B%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%93%8D%E4%BD%9CiOS%E7%9A%84%E6%A8%A1%E6%8B%9F%E5%99%A8-%E7%9C%9F%E6%9C%BA

查看模拟器运行包位置:

https://blog.youkuaiyun.com/changyixue/article/details/119935454

苹果提供了一个命令行工具来与iOS模拟器进行交互:iOS 模拟器管理工具 simctl

https://baijiahao.baidu.com/s?id=1725966972512379645&wfr=spider&for=pc

wda相关:【项目运行安装】

##3、安装 appium node server 端

https://shimo.im/docs/HCt3J9DgHwCQ8HdD/read

安装检测:https://blog.youkuaiyun.com/weixin_41923687/article/details/110438418

##4、客户端之 python客户端

https://github.com/appium/python-client

pip install Appium-Python-Client

##5、appium desktop

https://github.com/appium/appium-desktop/releases

https://inspector.appiumpro.com/ 网页版。 /wd/hub

https://github.com/appium/appium-inspector

https://github.com/appium/appium/tree/c43acc23ee80d461747c1912cdcfb136280001a0/docs/en

https://github.com/appium/appium/blob/c43acc23ee80d461747c1912cdcfb136280001a0/docs/en/writing-running-appium/caps.md 配置说明文档

##6、appium相关操作知识

二、web自动化selenium篇

##1、Selenium3和4 的不同

##2、selenium4 的新特性

相对定位:https://www.jianshu.com/p/8c1de824d292

##3、驱动和自动管理

浏览器驱动安装介绍:https://www.selenium.dev/zh-cn/documentation/webdriver/getting_started/install_drivers/

自动管理驱动:https://github.com/SergeyPirogov/webdriver_manager

##4、selenium的常规使用

@@1、鼠标 操作篇

https://blog.youkuaiyun.com/seanyang_/article/details/127459950

ActionChains方法列表

click(on_element=None) ——单击鼠标左键

click_and_hold(on_element=None) ——点击鼠标左键,不松开

context_click(on_element=None) ——点击鼠标右键

double_click(on_element=None) ——双击鼠标左键

drag_and_drop(source, target) ——拖拽到某个元素然后松开

drag_and_drop_by_offset(source, xoffset, yoffset) ——拖拽到某个坐标然后松开

key_down(value, element=None) ——按下某个键盘上的键

key_up(value, element=None) ——松开某个键

move_by_offset(xoffset, yoffset) ——鼠标从当前位置移动到某个坐标

move_to_element(to_element) ——鼠标移动到某个元素

move_to_element_with_offset(to_element, xoffset, yoffset) ——移动到距某个元素(左上角坐标)多少距离的位置

perform() ——执行链中的所有动作

release(on_element=None) ——在某个元素位置松开鼠标左键

send_keys(*keys_to_send) ——发送某个键到当前焦点的元素

send_keys_to_element(element, *keys_to_send) ——发送某个键到指定元素

@@2、键盘 操作篇

https://blog.youkuaiyun.com/weixin_44169484/article/details/119781258

https://blog.youkuaiyun.com/qq_44921056/article/details/123163923

import org.openqa.selenium.Keys

WebElement.sendKeys(Keys.DOWN);

WebElement.sendKeys(Keys.RETURN);

WebElement.sendKeys(Keys.DOWN + Keys.ENTER);

@@3.模拟鼠标滚动操作

模拟鼠标滑轮滚动:https://www.cnblogs.com/ckxingchen/p/17057058.html

@@4.截图 操作

https://blog.youkuaiyun.com/qq_43577241/article/details/104476160

browser.save_screenshot('xxx.png')

截图到文件:browser.get_screenshot_as_file('xxx.png')

div组件截图:

el=browser.find_element_by_css_selector("#pane-0 > div > div:nth-child(1)")

el.screenshot('D:\\xxx.png')

@@5.cookie操作和 导航栏操作

https://blog.youkuaiyun.com/weixin_44169484/article/details/119706490

https://blog.youkuaiyun.com/huilan_same/article/details/52343912

@@6.弹窗拦截 和下拉框选择 ,时间日期控件选择

https://blog.youkuaiyun.com/weixin_44169484/article/details/119716783

https://blog.youkuaiyun.com/weixin_44169484/article/details/119761412

https://blog.youkuaiyun.com/huilan_same/article/details/52385401

附加:辨识alert、window以及操作

https://blog.youkuaiyun.com/huilan_same/article/details/52298460

附加:checkbox、radiobox

https://blog.youkuaiyun.com/huilan_same/article/details/52287955

@@7.iframe切换和 窗口切换,滚动条的滚动

https://blog.youkuaiyun.com/weixin_44169484/article/details/119744709

https://blog.youkuaiyun.com/weixin_44169484/article/details/119779154

https://blog.youkuaiyun.com/huilan_same/article/details/52131277

@@8. 富文本框 editor编辑器 与 文件上传

https://blog.youkuaiyun.com/huilan_same/article/details/52386274

https://blog.youkuaiyun.com/huilan_same/article/details/52439546

@@9.使用FireBug和FirePath

https://blog.youkuaiyun.com/huilan_same/article/details/52918048

@@10.xPath的使用

xpath篇:https://www.51cto.com/article/721904.html

最全:http://quan.51testing.com/pcQuan/article/144871?name=%E5%8C%97%E6%9E%81

https://blog.youkuaiyun.com/qq_42370150/article/details/92088503 xpath跨级定位:https://blog.youkuaiyun.com/mjp_erhuo/article/details/120024823 定位元素【父,兄弟等等】:https://blog.youkuaiyun.com/hb5cn/article/details/84937449

$x("//span[text()='经销商对账报表']")[0].click() $x('//*[@id="GroupFooterSection1"]//following::span[last()]')

$x('//*[@id="GroupFooterSection1"]//following::span')

$x('//*[@id="GroupFooterSection1"]//following::span[3]')

$x('//*[@id="GroupFooterSection1"]//following::span[contains(@class,"fcc2030b84-d796-4b51-aafe-6914f1ed29a2-4")]')

$x('//*[@id="GroupFooterSection1"]//following::span[contains(text(),"打印")]//following::*') $x('//*[@id="GroupFooterSection1"]//following::span[position()<10]')

@@11.自动化打包exe

https://blog.youkuaiyun.com/huilan_same/article/details/53669834

三、Cypress拓展

Cypress :网站和 vue自动化测试

https://docs.cypress.io/guides/component-testing/vue/overview#Framework-Support

https://blog.youkuaiyun.com/Q0717168/article/details/123617411 使用说明

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荣•厚德载物

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值