当前位置:网站首页>System test UI test summary and questions (interview)
System test UI test summary and questions (interview)
2022-07-01 12:32:00 【Dream Wuji】
List of articles
One . The system test
1. Ease of use , function , Branch , The border , Performance and other functional and non functional needs should be tested
2. The need for intervention must be early , The earlier intervention can not only reduce costs , It also avoids unnecessary trouble in the follow-up work
3. Test cases should be as comprehensive as possible , It is best to test more with less test cases bug
4. You found one in the test bug, But the development manager doesn't think it's a bug, How should you solve .
1) If it is not a mistake, you should actively admit that it is not a defect .
2) If the requirements are not clear, strengthen communication with the developer to supplement the requirements .
3) If you argue with the developer endlessly, you should invite the superior to judge .
5. How to divide the defect level of software ?
serious :
1. A crash caused by a program , To withdraw illegally
2. Dead cycle
3. Database deadlock
4. Program interruption due to wrong operation
5. Function error
6. Connection error with database
7. Data communication error .
More serious :
1. Program error
2. Program interface error
3. Table of database 、 Business rules 、 The default value does not add constraints such as integrity .
generality :
1. Operation interface error ( Including the definition of column names in the data window 、 Is the meaning consistent )
2. Print the content 、 Format error
3. Simple input restrictions are not placed in the foreground for control
4. No prompt for deletion
5. There are too many empty fields in the database table .
Suggest :
1. The interface is not standard
2. The auxiliary description is not clear
3. The input and output are not standardized
4. Long operation did not prompt the user
5. Prompt window text does not use industry terms
6. There is no obvious distinction between the inputable area and the read-only area .
UI test
One . Automate usage scenarios :
- Stable demand , Scenes that do not change frequently .
- Long R & D and maintenance cycle , Scenarios that require frequent regression testing .
- Scenarios where the same test needs to be run repeatedly on multiple platforms .
- Scenarios that cannot be achieved or cost too much through manual testing .
- The development of the tested software is relatively standardized , And can guarantee the testability of the system .
- Scenarios where testers already have programming capabilities .
Two .8 A basic positioning method :
#id location
driver.find_element_by_id()
#name location
driver.find_element_by_name()
#class location
driver.find_element_by_class_name()
# Tag name positioning , Commonly used in iframe; Those with fewer labels can also be used , By taking the subscript
driver.find_element_by_tag_name()
#xpath location , It can be used firepath To get this location
driver.find_element_by_xpath()
#css location
driver.find_element_by_css_selector()
#a Text positioning of labels
driver.find_element_by_link_text()
#a Local text positioning of label
driver.find_element_by_partial_link_text()
3、 ... and . Basic usage :
from selenium import webdriver
# Import selenium library
driver = webdriver.Chrome()
# This is a Google drive
driver.get('https://www.baidu.com')
# Open the web page
print(driver.title)
# Output webpage title
driver.quit()
driver.close()
# Close the browser
# The second kind
driver_path=r"geckodriver.exe" # drive
cls.driver=webdriver.Firefox(executable_path=driver_path)# Firefox
cls.driver.get('https://www.baidu.com')
cls.driver.maximize_window()
Common methods of browser
driver.set_window_size(wide,high)
# Window width 、 high
driver.back()
# Page back
driver.forward()
# Page forward
driver.refresh()
# page refresh
driver.title
# Used to get the title of the current page
driver.current_url
# The user gets the URL
driver.find_element_by_id("").clear()
# Clear text
driver.find_element_by_id("").send_keys("selenium")
# Analog key input selenium
driver.find_element_by_id("").click()
# Stand alone element
driver.find_element_by_id("").submit()
# Enter to submit
driver.find_element_by_id("").text
# Get the text of the element
The mouse operation
# The runtime needs to import
from selenium.webdriver.common.action_chains import ActionChains
apple = driver.find_element_by_id("wk")
# To perform all ActionChains The behavior stored in ;
ActionChains(driver).context_click(apple).perform()
# Right click
ActionChains(driver).double_click(apple).perform()
# double-click
ActionChains(driver).drag_and_drop(apple).perform()
# Drag the
ActionChains(driver).move_to_element(apple).perform()
# Mouse hovering
Keyboard operation
driver.find_element_by_id("").send_keys(Keys.CONTROL,'a')
# Future generations (Ctrl+A)
driver.find_element_by_id("").send_keys(Keys.CONTROL,'c')
# Copy (Ctrl+C)
driver.find_element_by_id("").send_keys(Keys.CONTROL,'x')
# shear (Ctrl+X)
driver.find_element_by_id("").send_keys(Keys.CONTROL,'v')
# Paste (Ctrl+V)
driver.find_element_by_id("").send_keys(Keys.F1)
# keyboard F1
problem & solve
1.pyinstaller stay pycharm Download failed in , stay cmd Of pip install pyinstaller The download still failed
Solution :
Download a pyinstaller-3.6-py2.py3-non-any.whl file , Input again
pip install pyinstaller-3.6-py2.py3-non-any.whl Download it ( To get into whl The directory where the file is located download )
【 Be careful : First configure the environment variables 】
- pyinstaller Execute after packaging exe The program prompts that there is no module
Solution :
run Where to put it exe Just put it there , Otherwise, change the import path in the module
3. There are often errors that the element cannot be found , The code is correct
The code runs too fast , The page hasn't been loaded yet , Add one more time.sleep()
4. use class Cannot locate element
Alone with class Attribute positioning , There may be multiple elements that are the same class attribute , You need to find the only... Of the target element One attribute positioning .
5.implicitly_wait() And time.sleep() The difference between
(1)implicitly_wait() Indicates an implicit wait , If the element cannot be found, it will be accessed circularly until the time runs out
(2)time.sleep() Indicates an explicit wait , Fixed waiting time
(3)WebDriverWait(driver, 20, 0.5).until(expected_conditions.alert_is_present())
Explicit waiting : Explicit waiting is waiting for elements ; Before each element search, you need to emphasize :
among ,20s Indicates the maximum waiting time ,0.5s Indicates the polling interval ; When an element is detected, it stops waiting , Perform the next action ;
6. Pop up window processing
If it is the pop-up window of the browser , That is, the element cannot be located , use switch_to_alert() Processing is ok . If it is a window written by developers , Direct operation with element positioning .
7.document The use of , Remove the added elements
边栏推荐
- 系统测试UI测试总结与问题(面试)
- 强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
- Compile and debug net6 source code
- How to install php7 and perform performance test using yum
- Ansible的playbook
- Sort out relevant contents of ansible
- MySQL common functions
- LeetCode 454. Add four numbers II
- 【datawhale202206】pyTorch推荐系统:精排模型 DeepFM&DIN
- GID:旷视提出全方位的检测模型知识蒸馏 | CVPR 2021
猜你喜欢

Machine learning - Data Science Library - day two

【datawhale202206】pyTorch推荐系统:多任务学习 ESMM&MMOE

Indefinite integral

比特熊直播间一周年,英雄集结令!邀你来合影!

Onenet Internet of things platform - mqtt product equipment upload data points
![[brain opening] west tide and going to the world series](/img/b2/444af296e170d19629800b3d4c50fa.jpg)
[brain opening] west tide and going to the world series

Sort out relevant contents of ansible

Sleep quality today 79 points

Typora realizes automatic uploading of picture pasting

本科毕业四年:工作,辞职,结婚,买房
随机推荐
[JS advanced] promise explanation
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
Onenet Internet of things platform - mqtts product equipment connected to the platform
[Maui] add click events for label, image and other controls
Sleep quality today 79 points
Arm GIC (V) how arm TrustZone supports security interrupt analysis notes.
(混更一篇)多个txt文本转一个表格
[Suanli network] technological innovation of Suanli Network -- key technology of operation service
使用BurpSuite对app抓包教程
二叉树的链式存储
leetcode 406. Queue Reconstruction by Height(按身高重建队列)
[JS] interview questions
[shell programming] - shell introductory learning
JS reverse | m3u8 data decryption of a spring and autumn network
Common chart usage of Bi tools
腾讯安全联合毕马威发布监管科技白皮书,解析“3+3”热点应用场景
Stack-------
How to use opcache, an optimization acceleration component of PHP
Huawei interview question: Recruitment
[106] 360 check font - check whether the copyright of local Fonts is commercially available