当前位置:网站首页>Test interview question set UI automated test
Test interview question set UI automated test
2022-07-26 19:30:00 【Code Xiaoyi】
One 、 list web Common element positioning methods in Automation ?
id: according to id To get elements , Return single element ,id Values are generally unique ;
name: According to the name Attribute positioning ;
tagName: Locate according to the tag name of the element ;
className: According to the style of the element class Value positioning ;
linkText: Locate according to the text value of the hyperlink ;
partialLinkText: Locate according to some text values of the hyperlink ;
cssSelector:css Selector positioning ;
xpath: Locate by the path of the element ;
Two 、 Briefly describe what you know about delayed waiting ?
Mandatory waiting : Also called thread waiting , Wait through thread sleep , Wait for 5 second : Thread sleep(5000), Generally, forced waiting is not used , The main application scenario is where different systems interact .
An implicit wait : adopt implicitly Wait Delayed waiting for completion , Note that this is a wait for global settings , If the timeout is set to 10 second , Used implicitlyWait after , If you don't find the element the first time , Will be in 10 I'm going to loop around for seconds to find the elements , If exceeded 10 Seconds have not been found , Throw an exception , Hard waiting is more intelligent , It can be configured globally , But it can only be used for element positioning .
Explicit waiting : Also known as intelligent waiting , Specify the wait time for the specified element location , Find elements within the specified time range , Find the element and return directly , If the element is not found in the timeout , Throw an exception , Show waiting is selenium One of the more flexible waiting methods , His implementation principle is actually through while Keep trying what needs to be done .
3、 ... and 、 How to simulate the forward and backward of the browser 、 Refresh ?
As follows :
driver.navigate().back(); // back off
driver.navigate().forward();// Forward
driver.navigate().refresh();// Refresh
Four 、Selenium Automate how to upload files ?
If it is input Element file upload , Can pass Selenium In the middle of send_keys Way to deliver , But this method has great limitations , If you encounter something like passing js There will be some problems with the calling component ; At this time, you need to complete the upload operation through some ways of interacting with the system , Such as through autoit,pywinauto Or is it pyautogui These third-party libraries operate .
5、 ... and 、UI How to design automated test cases ?
UI Automated test cases are extracted from manual test cases , Compared with manual test cases , Automated test cases pay more attention to the preciseness of use cases , When selecting use cases, follow the following principles :
Give priority to the use cases that cover the core functions of the product ;
In terms of cost , Don't choose use cases where the process is too complex ;
The selected use case can be repeated execution , Cumbersome part , For example, field validation 、 Verification prompt ;
Give priority to positive test cases , Reverse use cases are generally complex 、 A large number ;
6、 ... and 、 What is? PO Pattern ?
PO Pattern , Its full name is Page Object Model , abbreviation POM, Is the page object mode . The process of abstracting or modeling a page , Is to convert a specific page into an object in the programming language , Page properties are converted into object properties , Convert page operations into object methods . Put the pages one by one web The element is designed as the attribute of the page object , Put the operation on the page ( If you click 、 Input, etc ) Behavior designed as a page object . In automated testing , It is mainly used to separate page operation and test logic , The advantage of this is that the business and implementation are separated , Make automated test scripts more maintainable .
7、 ... and 、 Do you think PO What are the encapsulation principles of patterns ?
The public method represents a service provided by the page , For example, we can encapsulate the login into a login Method , Encapsulate the search method into a facility method , Encapsulate the registration operation into a register Methods ;
Try not to expose the inside of the page , For example, a HTML There is also a top-down structure of the page ;
stay PO Generally, no assertion is made , Can achieve the separation of page logic and test logic ;
PO Generally, the method inside returns self Or something else Page Object , It can also be an element attribute ;
Whole PO You don't need to encapsulate the behavior of the entire page , Encapsulate whatever logic is used ;
For unified operation , If there are different results , Can be expressed in different ways , For example, a successful login has a jump , There is an error when the login fails , If you log in, you will be authorized , Then it can be encapsulated into three separate methods :login success、login error、login invalid.
8、 ... and 、 How do you improve UI Stability of automated scripts ?
Try to use relative path xpath expression ;
Find elements with priority to display wait ;
Try to avoid dependencies between use cases , Use cases can be executed independently ;
Restore the test scenario after the execution of the use case , Avoid affecting the execution of other use cases ;
After the script fails to execute, add the retry mechanism , Improve the stability of use cases ;
Try to ensure a separate test environment , Avoid synchronizing other tests ;
Nine 、 be based on Web How to do automated testing at the end , Talk about your ideas and direction ?
Web End of the automation test , Basically, it simulates manual testers to do functional testing . Replace human operation with automatic execution of machine .web There are two directions for products presented at the end, which can be tested automatically : Interface layer and interface operation layer , And the proportion of interface layer automation is higher than that of interface operation layer . It mainly carries out automatic test on the stable function of the product , It is mainly used for the smoke test of the core function of the product 、 regression testing . Start with the core function of the system , Then expand slowly according to the situation .
Ten 、UI Automated testing , How to be a cluster ?
Selenium Grid, Distributed execution use cases ;
Appium Use STF Manage multiple devices ;
Docker+K8S Management cluster ;
Finally, thank everyone who reads my article carefully , The following online link is also a very comprehensive one that I spent a few days sorting out , I hope it can also help you in need !

These materials , For those who want to change careers 【 software test 】 For our friends, it should be the most comprehensive and complete war preparation warehouse , This warehouse also accompanied me through the most difficult journey , I hope it can help you ! Everything should be done as soon as possible , Especially in the technology industry , We must improve our technical skills . I hope that's helpful ……
If you don't want to grow up alone , Unable to find the information of the system , The problem is not helped , If you insist on giving up after a few days , You can click the small card below to join our group , We can discuss and exchange , There will be various software testing materials and technical exchanges .
Typing is not easy , If this article is helpful to you , Click a like, collect a hide and pay attention , Give the author an encouragement . It's also convenient for you to find it quickly next time .
Self study recommendation B Stop video :
Zero basis transition software testing : Self taught software testing , Got the byte test post offer, Is the B The best video station !
Advanced automation testing : Huawei has landed , Salary increase 20K,2022 Most suitable for self-study python Automated test tutorial , Spend it yourself 16800 Bought , Free sharing

边栏推荐
- Advantages of advanced anti DDoS IP in Hong Kong and which industries are suitable for use
- LeetCode-138-复制带随机指针的链表
- Sre person in charge of station B personally describes the multi activity disaster recovery construction after the 713 accident | takintalks share
- 指标和标签是做什么的
- [C language implementation] - dynamic / file / static address book
- AttributeError: ‘Upsample‘ object has no attribute ‘recompute_ scale_ factor‘
- Gongfu developer community is settled! On July 30!
- Synchronized理论
- Machine learning notes - building a recommendation system (6) six automatic encoders for collaborative filtering
- The passwords are consistent, and the total display is as shown in the figure below
猜你喜欢

C#创建及读取DAT文件案例

Data Lake -- concept, characteristics, architecture and case overview

J2 Redis之 AOF&RDB

J3: redis master-slave replication

“蔚来杯“2022牛客暑期多校训练营1

PMP每日一练 | 考试不迷路-7.26(包含敏捷+多选)

配置服务器环境

ReentrantLock学习之---释放锁过程

What do indicators and labels do
The passwords are consistent, and the total display is as shown in the figure below
随机推荐
如何保护电子商务网站免受网络攻击?
Introduce the difference between @getmapping and @postmapping in detail
How to solve the problem that win11 has been switched on after upgrading
ReentrantLock学习之公平锁过程
彻底关闭win10自动更新
Advantages of advanced anti DDoS IP in Hong Kong and which industries are suitable for use
The diagram of user login verification process is well written!
Here comes the most complete introduction to MES system
周末看点回顾|数字人民币产业联盟成立;中国移动宣布:和飞信将停止服务…
conda转移项目虚拟环境必备技能+pip速度下载太慢解决办法
第九章 实用建模技术
C#获取本地时间/系统时间
Is it safe for CSC qiniu members to open preferential accounts? I don't know if it's the lowest Commission
最后一篇博客
C语言-入门-语法-字符串(十一)
[MySQL from introduction to proficiency] [advanced chapter] (VIII) clustered index & non clustered index & joint index
Tensorflow GPU 1.15 installation
J3: redis master-slave replication
[yolov5] - detailed version of training your own dataset, nanny level learning, logging, hand-in-hand tutorial
EN 1504-7混凝土结构保护和修理用产品钢筋防腐—CE认证