当前位置:网站首页>Appium fundamentals of automated testing - basic principles of appium
Appium fundamentals of automated testing - basic principles of appium
2022-07-01 03:38:00 【Test - Eight Precepts】
1、APPium Automated test architecture
APPium It's a C/S Automated test framework for architecture ,APPium The core of is actually an exposed series REST API Of server.( That is to say Appium The core of is one that provides a set of REST API Of Web The server .)
This server It's very simple : Listening on a port , Then receive from client( client ) Sent to command( command ). Translate these command, Put these command Transfer to a form that mobile devices can understand and send to mobile devices , Then the mobile device performs these command after , Return the execution result to appium server,appium server Then return the execution result to client.
ad locum client In fact, it is to initiate command The equipment , Generally speaking, it is our code execution machine , perform appium The machine that tests the code . In a narrow sense , You can put client Understood as code , The code can be java/ruby/python/js Et al. , As long as it does webdriver A standard agreement will do .
This design idea brings some benefits :
- Can bring multilingual support ;
- You can put server Put it on any machine , Even ECS can ;
( Yes ,appium and webdriver Naturally suitable for cloud testing )
2、APPium Architecture diagram :
3、Session
- session It's just a conversation , stay webdriver/appium, All your work is always session start It can be done after .
- Generally speaking , adopt POST /session This URL, Then incoming Desired Capabilities( One JSON object ) I can turn it on session 了 .
- Turn on session after , Will return a globally unique session id, In the future, almost all requests must bring this session id, Because of this seesion id Represents the browser you open or the simulator of your mobile device .
- Think further , because session id It's the only one , Then start multiple... On the same machine session It becomes possible , This is the same. selenium gird The specific theoretical basis .
4、Desired Capabilities
Desired capabilities Yes, send to Appium A set of keys and values on the server side ( That is, mapping or hashing ), It carries some configuration information .
essentially , What is this thing key-value The object of form . You can understand it as java Inside map,python Dictionary in ,ruby Inside hash as well as js Inside json object . actually Desired Capabilities In transmission, it is json object .
Desired Capabilities The most important role is to tell Appium server The context of this test .
- Is this a browser test or a mobile test ?
- If it is a mobile terminal test, it is a test android still ios?
- If you test android So which one are we going to test app?
Appium server These questions Desired Capabilities Must be answered , otherwise Appium server Don't buy it , Naturally, you can't complete the movement app Or the start of the browser .
The details are as follows :
For example, we might set the platformName capability to iOS to tell Appium that we want an iOS session, rather than an Android one. Or we might set the safariAllowPopupscapability to true in order to ensure that, during a Safari automation session, we’re allowed to use JavaScript to open up new windows. See the capabilities doc for the complete list of capabilities available for Appium
Translate the following :
for example , We can platformName The function is set to iOS, Informing Appium We want one iOS conversation , instead of Android conversation . perhaps , We can safariAllowPopupscapability Set to true, To ensure that Safari During an automation session , Allow us to use JavaScript Open a new window . Refer to the feature documentation for information that can be used to Appium A complete list of functions .
5、Appium Server
This is every time we use... On the command line appium Something ordered to open .
Appium server Yes, it is Node.js Written . We can compile with source code or from NPM Direct installation .
Installation mode
$ npm install -g appium $ appium
explain :
- Appium There are many language libraries on the server side Java, Ruby, Python, PHP, JavaScript and C#, These libraries all implement Appium Yes WebDriver Protocol extension .
- When using Appium When , You just need to use these libraries instead of regular WebDriver Library will do .
Tips : We do not recommend using this method for installation Appium, The following is recommended Appium Desktop Installation by .
6、Appium Clients
Because of native webdriver api Is for web End design , Therefore, it will be a little nondescript to use on the mobile end .appium The government provided a set of appium client, Covering multiple languages ruby/java/python, in my opinion ruby client To achieve the best .
During the test , Generally use these client Library to replace native webdriver library .
This is not actually a replacement , Count as client Primordial webdriver Some mobile terminal extensions are carried out , Added some convenient methods ,appium client Let's make it easier to write test cases with better readability .
Appium Download address of client library :http://appium.io/downloads.html
7、Appium Desktop
Appium Desktop Is in Appium Server It is encapsulated into a server with a graphical interface , You can download and install... On any platform .
It's related to running Appium Server Everything you need is bundled together , So don't worry Node Environmental Science .
It also comes with a checker , Used to view the hierarchy of applications, etc . When writing tests , This will come in handy .
a key : Supporting learning materials and video teaching
So here I have carefully prepared the detailed information of the above outline in The link below is as follows
边栏推荐
- [小样本分割]论文解读Prior Guided Feature Enrichment Network for Few-Shot Segmentation
- Sort linked list (merge sort)
- Include() of array
- 多元线性回归
- TEC: Knowledge Graph Embedding with Triple Context
- idea插件备份表
- LeetCode 31下一个排列、LeetCode 64最小路径和、LeetCode 62不同路径、LeetCode 78子集、LeetCode 33搜索旋转排序数组(修改二分法)
- 详解Spark运行模式(local+standalone+yarn)
- pytorch训练深度学习网络设置cuda指定的GPU可见
- Detailed explanation of ES6 deconstruction grammar
猜你喜欢
IPv4 and IPv6, LAN and WAN, gateway, public IP and private IP, IP address, subnet mask, network segment, network number, host number, network address, host address, and IP segment / number - what does
BluePrism注册下载并安装-RPA第一章
Explain spark operation mode in detail (local+standalone+yarn)
How to achieve 0 error (s) and 0 warning (s) in keil5
Pyramid Scene Parsing Network【PSPNet】论文阅读
ASGNet论文和代码解读2
Gorilla/mux framework (RK boot): RPC error code design
Download and installation configuration of cygwin
[small sample segmentation] interpretation of the paper: prior guided feature enrichment network for fee shot segmentation
服务器渲染技术jsp
随机推荐
pytorch训练深度学习网络设置cuda指定的GPU可见
ASGNet论文和代码解读2
pytorch nn.AdaptiveAvgPool2d(1)
Pathmeasure implements loading animation
Nacos
Explain spark operation mode in detail (local+standalone+yarn)
leetcode 1818 绝对值,排序,二分法,最大值
Thread data sharing and security -threadlocal
Take you through a circuit board, from design to production (dry goods)
5、【WebGIS实战】软件操作篇——服务发布及权限管理
后台系统页面左边菜单按钮和右边内容的处理,后台系统页面出现双滚动
JS daily development tips (continuous update)
用小程序的技术优势发展产业互联网
数据库中COMMENT关键字的使用
【伸手党福利】开发人员重装系统顺序
文件上传下载
pytorch中的双线性插值上采样(Bilinear Upsampling)、F.upsample_bilinear
pytorch nn. AdaptiveAvgPool2d(1)
Blueprism registration, download and install -rpa Chapter 1
Listener listener