当前位置:网站首页>Appium foundation - appium inspector positioning tool (I)

Appium foundation - appium inspector positioning tool (I)

2022-07-07 01:33:00 Test - Eight Precepts

1、Appium Inspector Introduce

We said before Appium Server There are two ways to start ,

  • One is Appium Desktop The startup mode with graphical interface , It's called the desktop version ;
  • Another version is through npm install , Started with command line arguments Appium Server.

and Appium Inspector The tools are right there Appium Desktop in ,Appium Inspector yes Appium Desktop An attached element location checker , It's convenient to debug and locate applications .
Appium Inspector The tool also supports Android Systems and IOS Element positioning of the native interface in the system .

2、Appium Inspector Open mode

Appium Desktop After installation , Double-click to open .

explain : The interface has 3 individual Tab Options

  • Simple: The default configuration , Monitor local 4723 port ;
  • Advanced: Advanced settings , You can customize Appium server End configuration , After configuration, it can be saved to Presets;
  • Presets: modify Advanced Configuration items in advanced settings .

Generally, we test directly Simple that will do , Click on  Start Server  Button , start-up Appium server, And turn on the monitor 4723 port .
After opening the service , The interface jumps to the server console , Here's the picture :

Tips :
The console displays the log information in the running script , There is... In the upper right corner 3 Button , Namely :

  • The first button Start Inspector Session, Turn on Appium Inspector Positioning tools ;
    Be careful :inspector There will be a new meeting Session;
  • The second button Get Raws Logs, Download... In the current console log Information ;
  • The third button Stop Server, Close current Appium server.
    There are two ways to open Appium Inspector Tools ,
  • Mode one : Click the first of the three buttons in the upper right corner ( A magnifying glass like button ), open Appium Inspector Tools .
  • Mode two : Click on the top left corner File-->New Session Window... Ctrl+N It can also be opened Appium Inspector Tools .

Here's the picture :

Appium Inspector The interface after the tool is opened is shown in the figure below :

3、Appium Inspector Layout introduction

explain :

  1. Layout 1 yes Appium Inspector Service settings
    Automatic Server : Automatic server
    Custom Server : Custom server
    Select Cloud Providers : Choose a cloud provider
    We usually use Automatic Server that will do :
    Will use currently-running Appium Desktop server http://localhost:4723
    Will use the currently running Appium Desktop server http://localhost:4723.
  2. Layout 2 It's advanced settings
    You can set :
    Allow Unauthorized Certificates: Allow unauthorized certificates
    Use Proxy: Use proxy server
    For beginners, we usually don't have advanced settings .
  3. Layout 3 yes Desired Capabilities Parameter setting
    Desired Capabilities: To write Desired Capabilities Parameters
    Saved Capability Sets: Saved Desired Capabilities, You can view and modify .
    Attach to Session...: Attach to session ...( When I use it, I'm saying )

4、Appium Inspector Configuration of tools

1)Appium Inspector Tool use premise

  • open Appium Desktop, Turn on Appium Inspector Tools .
  • The tested equipment is in power on state ( Mobile phone or virtual machine ).
  • Make sure the computer and device are linked , That is to say
    cmd Go to the command line terminal ,
    Input adb connect 127.0.0.1:21503 Link carefree Simulator ,
    Input adb devices Can get the device name .

2)Appium Inspector Server settings and advanced settings

  • server setting : choice Automatic Server( Be sure to click , Select )
  • Advanced settings : Do not set

3) To write Desired Capabilities Parameters ( a key )
You can manually add... Line by line on the left , Here's the picture :

Tips : The format of the second column is for the third column value In terms of the .
Also can put the Json Format data, edit well , Paste directly on the right JSON Representation in .

Put... Directly Json Paste the formatted data directly

Click save , The data will be synchronized to the left , Here's the picture :

4) preservation Desired Capabilities Parameters
If necessary , After editing Desired Capabilities After the parameters , It can be saved , Convenient for future management and use .

5) View and modify stored Desired Capabilities
Click on Saved Capability Sets TAB , You can view and modify stored Desired Capabilities.

6) Turn on Session, Connect the mobile phone to get the mobile phone interface
Click on Start Session, Turn on use Appium Inspector Tools , Here's the picture :

explain

  • Appium Inspector We need to manually create a session, In fact, it is a client , and Appium server Connect , And need to be in Desired Capabilities Fill in some parameters .
  • The required function is in Desired Capabilities The keys and values encoded in the object , When a new automation session is requested , from Appium Client sent to Appium server The server .Desired Capabilities tell Appium Driver all kinds of important information about how you want the test to work . Final Desired Capabilities Will serve as a JSON Object sent to Appium.
  • Of the required functions Desired Capabilities The object can be in WebDriver Script in the test , It can also be in Appium Server GUI Set in ( adopt Inspector In the session , That's the way of introduction above ).
    Tips :
    When Appium Inspector When you can't grab the phone screen , You can shut down and restart adb service , Or restart Appium Inspector service .
  • adb kill-server
  • adb start-server

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

 

原网站

版权声明
本文为[Test - Eight Precepts]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061803165725.html