当前位置:网站首页>系统测试UI测试总结与问题(面试)
系统测试UI测试总结与问题(面试)
2022-07-01 12:26:00 【梦无矶】
一.系统测试
1.易用性,功能,分支,边界,性能等功能性和非功能性需要都要进行测试
2.介入需求一定要早 ,越早介入不仅可以减少成本,还避免了后续工作不必要的麻烦
3.测试用例尽量覆盖全面,最好做到用少的测试用例测试出多的bug
4.你在测试中发现了一个bug,但是开发经理认为这不是一个bug,你应该怎样解决。
1)如果不是错误则应该主动承认不是缺陷。
2)如果是需求不明确的则应和开发加强沟通补充需求。
3)如果和开发争论不休应该邀请上级判断。
5.软件的缺陷等级应如何划分?
严重:
1.由于程序所引起的死机,非法退出
2.死循环
3.数据库发生死锁
4.因错误操作导致的程序中断
5.功能错误
6.与数据库连接错误
7.数据通讯错误。
较严重:
1.程序错误
2.程序接口错误
3.数据库的表、业务规则、缺省值未加完整性等约束条件。
一般性:
1.操作界面错误(包括数据窗口内列名定义、含义是否一致)
2.打印内容、格式错误
3.简单的输入限制未放在前台进行控制
4.删除操作未给出提示
5.数据库表中有过多的空字段。
建议:
1.界面不规范
2.辅助说明描述不清楚
3.输入输出不规范
4.长操作未给用户提示
5.提示窗口文字未采用行业术语
6.可输入区域和只读区域没有明显的区分标志 。
UI测试
一.自动化使用场景:
- 需求稳定,不会频繁变动的场景。
- 研发和维护周期长,需要频繁执行回归测试的场景。
- 需要在多个平台上重复运行相同测试的场景。
- 通过手工测试无法实现或成本太高的场景。
- 被测软件开发较为规范,并且能够保证系统可测试性的场景。
- 测试人员已经具备编程能力的场景。
二.8种基础定位方法:
#id定位
driver.find_element_by_id()
#name定位
driver.find_element_by_name()
#class定位
driver.find_element_by_class_name()
#标签名定位,一般用于iframe;标签较少的也可以使用,用取下标的方式
driver.find_element_by_tag_name()
#xpath定位,可以用firepath来获得这个定位
driver.find_element_by_xpath()
#css定位
driver.find_element_by_css_selector()
#a标签的文本定位
driver.find_element_by_link_text()
#a标签的局部文本定位
driver.find_element_by_partial_link_text()
三.基本用法:
from selenium import webdriver
#导入selenium库
driver = webdriver.Chrome()
#这是Google驱动
driver.get('https://www.baidu.com')
#打开网页
print(driver.title)
#输出网页的title
driver.quit()
driver.close()
#关闭浏览器
#第二种
driver_path=r"geckodriver.exe" #驱动
cls.driver=webdriver.Firefox(executable_path=driver_path)#火狐浏览器
cls.driver.get('https://www.baidu.com')
cls.driver.maximize_window()
浏览器的常用方法
driver.set_window_size(wide,high)
#窗口宽、高
driver.back()
#页面后退
driver.forward()
#页面前进
driver.refresh()
#页面刷新
driver.title
#用于获得当前页面的标题
driver.current_url
#用户获得当前页面的URL
driver.find_element_by_id("").clear()
#清除文本
driver.find_element_by_id("").send_keys("selenium")
#模拟按键输入selenium
driver.find_element_by_id("").click()
#单机元素
driver.find_element_by_id("").submit()
#回车提交
driver.find_element_by_id("").text
#获取元素的文本
鼠标操作
#运行时需要导入
from selenium.webdriver.common.action_chains import ActionChains
apple = driver.find_element_by_id("wk")
#执行所有 ActionChains 中存储的行为;
ActionChains(driver).context_click(apple).perform()
#右击
ActionChains(driver).double_click(apple).perform()
#双击
ActionChains(driver).drag_and_drop(apple).perform()
#拖动
ActionChains(driver).move_to_element(apple).perform()
#鼠标悬停
键盘操作
driver.find_element_by_id("").send_keys(Keys.CONTROL,'a')
#全选(Ctrl+A)
driver.find_element_by_id("").send_keys(Keys.CONTROL,'c')
#复制(Ctrl+C)
driver.find_element_by_id("").send_keys(Keys.CONTROL,'x')
#剪切(Ctrl+X)
driver.find_element_by_id("").send_keys(Keys.CONTROL,'v')
#粘贴(Ctrl+V)
driver.find_element_by_id("").send_keys(Keys.F1)
#键盘 F1
问题&解决
1.pyinstaller在pycharm中下载失败,在cmd的pip install pyinstaller下载依然失败
解决方案:
下载一个pyinstaller-3.6-py2.py3-non-any.whl文件,再输入
pip install pyinstaller-3.6-py2.py3-non-any.whl下载即可(要进入whl该文件所在目录 下载)
【注意:要先配置好环境变量】
- pyinstaller打包后执行exe程序提示没有某模块
解决方案:
run放哪exe就放哪,不然就改模块里面的导入路径
3.经常出现找不到该元素的错误,代码无误
代码运行太快,页面还没加载出来,加一个time.sleep()
4.用class定位不到元素
单独用class属性定位,可能会有多个元素是相同的class属性,需要找目标元素的唯 一属性定位。
5.implicitly_wait()与time.sleep()之间的区别
(1)implicitly_wait()表示隐式等待,如果找不到元素会一直循环访问直到时间用尽
(2)time.sleep()表示显式等待,固定等待时间
(3)WebDriverWait(driver, 20, 0.5).until(expected_conditions.alert_is_present())
显式等待:显式等待是对元素的等待;在每次进行元素查找之前都需要强调一次:
其中,20s表示最大等待时间,0.5s表示轮询时间间隔;检查到元素即停止等待,执行下一个操作;
6.弹出窗口的处理
如果是浏览器自带的弹出窗口,即元素定位不到的,用switch_to_alert()处理就可以。如果是开发人员自写的窗口,用元素定位直接操作即可。
7.document的运用,移除增加元素
边栏推荐
- Eurake分区理解
- 队列的链式存储
- Talk about biological live broadcast - genovis Zhang Hongyan antibody specific enzyme digestion technology helps to characterize the structure of antibody drugs
- MySQL workbench data modeling function
- Leetcode force buckle (Sword finger offer 31-35) 31 Stack push pop-up sequence 32i II. 3. Print binary tree from top to bottom 33 Post order traversal sequence 34 of binary search tree The path with a
- [106] 360 check font - check whether the copyright of local Fonts is commercially available
- 腾讯黎巍:深耕“监管科技”,护航数字经济行稳致远
- Sort out relevant contents of ansible
- [Yu Yue education] financial management reference materials of Ningbo University of Finance and Economics
- 巩固-C#运算符
猜你喜欢

Virtualenv+pipenv virtual environment management

Machine learning - Data Science Library Day 3 - Notes

【datawhale202206】pyTorch推荐系统:精排模型 DeepFM&DIN

Typora realizes automatic uploading of picture pasting

LeetCode力扣(剑指offer 31-35)31. 栈的压入弹出序列32I.II.III.从上到下打印二叉树33. 二叉搜索树的后序遍历序列34. 二叉树中和为某一值的路径35. 复杂链表的复制

2022-06-28-06-29

技术分享 | MySQL:从库复制半个事务会怎么样?
![[JS] interview questions](/img/f3/8cf430b999980190a250f89537715e.jpg)
[JS] interview questions

Queue operation---

Indefinite integral
随机推荐
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4
腾讯安全发布《BOT管理白皮书》|解读BOT攻击,探索防护之道
被锡膏坑了一把
Blue Bridge Cup multi interface switching processing (enumeration plus state machine method)
Application of stack -- bracket matching problem
How to use opcache, an optimization acceleration component of PHP
The Missing Semester
[20211129] jupyter notebook remote server configuration
C # dependency injection (straight to the point) will be explained as soon as you see the series
JPA and criteria API - select only specific columns - JPA & criteria API - select only specific columns
Mysql database knowledge collation
[datawhale202206] pytorch recommendation system: recall model DSSM & youtubednn
数字信号处理——线性相位型(Ⅱ、Ⅳ型)FIR滤波器设计(2)
Sleep quality today 79 points
(mixed version 1) multiple TXT text to one table
Talk about biological live broadcast - genovis Zhang Hongyan antibody specific enzyme digestion technology helps to characterize the structure of antibody drugs
Ansible的playbook
What are the PHP FPM configuration parameters
华为面试题: 招聘
双链表有关操作