当前位置:网站首页>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


边栏推荐
- 后台系统页面左边菜单按钮和右边内容的处理,后台系统页面出现双滚动
- 过滤器 Filter
- Error: plug ins declaring extensions or extension points must set the singleton directive to true
- 【伸手党福利】JSONObject转String保留空字段
- Complete knapsack problem
- pytorch中的双线性插值上采样(Bilinear Upsampling)、F.upsample_bilinear
- pytorch nn. AdaptiveAvgPool2d(1)
- 网页不能右键 F12 查看源代码解决方案
- [reading notes] copywriting realization -- four golden steps for writing effective copywriting
- You cannot right-click F12 to view the source code solution on the web page
猜你喜欢

TEC: Knowledge Graph Embedding with Triple Context

Processing of menu buttons on the left and contents on the right of the background system page, and double scrolling appears on the background system page

数据交换 JSON

jeecgboot输出日志,@Slf4j的使用方法

Asgnet paper and code interpretation 2

E15 solution for cx5120 controlling Huichuan is620n servo error

完全背包问题

4、【WebGIS实战】软件操作篇——数据导入及处理

Listener listener

pytorch训练深度学习网络设置cuda指定的GPU可见
随机推荐
Gorilla/mux framework (RK boot): RPC error code design
Leetcode 31 next spread, leetcode 64 minimum path sum, leetcode 62 different paths, leetcode 78 subset, leetcode 33 search rotation sort array (modify dichotomy)
ECMAScript 6.0
TEC: Knowledge Graph Embedding with Triple Context
JUC learning
Valid brackets (force deduction 20)
What happens when a function is called before it is declared in C?
RSN:Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs
Go tool cli for command line implementation
Pyramid Scene Parsing Network【PSPNet】论文阅读
JS日常开发小技巧(持续更新)
Md5sum operation
后台系统页面左边菜单按钮和右边内容的处理,后台系统页面出现双滚动
监听器 Listener
TEC: Knowledge Graph Embedding with Triple Context
How to use hybrid format to output ISO files? isohybrid:command not found
Split(), split(), slice(), can't you tell?
Ridge regression and lasso regression
C language EXECL function
Take you through a circuit board, from design to production (dry goods)