IDE settings and shortcut interaction¶
AirtestIDE offers some additional configuration. Select
Options-Settings in the menu bar of the main interface to see the coniguration options:
You can set AirtestIDE to Chinese zh_CN/English en_US in Language.
Skin theme settings¶
Theme drop-down menu, you can select
AirtestIDE skin theme. There are currently two themes available, the dark theme
DarkShadow and the light theme
Show Real-time Cursor Coordinate¶
Show Real-time Cursor Coordinate option to display the coordinates of the mouse position on the screen of the mobile phone in real time. At this point, click the right mouse button, you can also automatically copy the current coordinate information to the clipboard. In the code, you only need to paste directly to insert the coordinates of the click position.
When the real-time display coordinates are checked, the <Relative Coordinate` option will be checked, and the relative coordinates will be displayed in the range of (0, 0) to (1, 1). Using relative coordinates avoids problems with cross-resolution operating points that go beyond the screen, making coordinate operations more compatible.
Embedded Window Mode (Windows)¶
Some applications may not be embedded with the default scheme: they might be inoperative, get a black screen… We offer an alternative embedded scheme, to use it: select
Connect windows without embedding.
If you select this option, when embedding window, please use
Show Desktop to minimize all the apps on desktop, then restore only AirtestIDE and the tested app. Click
Select Window button, use the green frame to select the tested app. When the IDE device panel disappears, you can record normally.
Mobile Phone Display¶
When an Android phone is connected, AirtestIDE will sync the screen of the phone in the Device window in real time. If you think the resolution is low, you can adjust it here, higher number meaning higher definition.
Default value: 800, range: 300-2000.
You can adjust the font size in edit window and Log window. Default:
14px. In AirtestIDE, you can also hold
ctrl + mouse wheel to change the font size.
Edit Box Theme¶
According to the two different color skins provided by AirtestIDE, we have added the corresponding edit box themes to choose from. When the mouse hovers over the theme name, you can see a preview:
Auto Complete provides an automatic completion of python code in an edit window. By default, this feature is not checked because it may cause performance degradation on some machines.
After opening this option, you can enjoy the code completion of the airtest and poco libraries when editing the code in AirtestIDE. If you want to be able to perform more automatic completion of more python libraries, it is recommended to refer to the python environment deployment . After deploying the local Python environment, set the corresponding python.exe path in the
Custom Python Path option of the IDE, so you can use more powerful automatic completion of python code.
If you modify the path to
Custom Python Path, you need to restart the IDE to make the new code completion take effect.
Airtest module has 3 configuration options, by default they don’t need to be set up to run the AirtestIDE script.
Here is an example:
Set launcher path¶
Custom Launcher Path option sets a custom path of
launcher.py file. Usually this option is not required, please refer to tutorial for more details.
Reset to clear this option. Clicking
Edit opens a simple edit window, which can be used to quickly edit the
Set default storage path for log file¶
Default Log Path is used to specify the log directory when AirtestIDE is running scripts. The IDE will store the resulting log files and screenshots in this directory by default.
Reset will set the log directory to the default system’s temp directory. Clicking
Clear automatically clears the files in this directory and free up disk space. Please make sure there isn’t any important log file that needs to be kept before you do this.
Use local Python environment to run scripts (trial)¶
Custom Python Path allows to use your local
python.exe to run the already written scripts in AirtestIDE. AirtestIDE has a built-in python 3.6.5 environment, to use your local python environment (can run some locally installed third-party libraries, allows you to use local python2 environment, etc.), you can set this option to change the default
Open to open the file selection window, please select a locally installed
python.exe path. Click
Reset to clear the filled contents.
For macOS, you need to set python executable file path. If you use python system, use
which python command to get the path of python executable file (if it’s python3, use which python3):
>which python3 /Library/Frameworks/Python.framework/Version/3.6/bin/python3
Fill this path in the AirtestIDE settings window. Please note that the directory of the executable files should be in
bin/, not in python’s directory.
If you use a virtual environment, you need to fill in python’s executable file path of the virtual environment directory. For example, in macOS it may be
- If you want to use your local Python environment to run scripts, you need to deploy airtest and pocoui environment in advance. Please refer to
Using local python environment to run scriptsin [Running Script] (run_script.html) for deployment.
- If the local path of
python.exeis set in AirtestIDE,
AirtestIDE/sample/custom_launcher.pywill be used by default to start the script. If you want to use your own
launcher.py, please set your own script path of
launcher.pyin AirtestIDE. For more about launcher.py, please check Set launcher path .
Poco element refresh interval¶
Refresh Interval option is used to configure the interval time of refreshing poco-UI tree in AirtestIDE’s assistance window after connecting
Unit: s, 5s by default.
Set the window’s position in Poco-Windows mode¶
After embedding a Windows’ game window, if you want to check interface elements with Poco, you can set the window’s position with
Windows Content Area Rect. This is to be able to display poco element tags on Windows’ windows, without any impact on script execution if not set.
Set Chrome path¶
Click to set the path of
Chrome.exe to perform Selenium’s functions. For more details, please refer to Selenium tutorial .
Note: You don’t need to set Chrome path if you have installed geckodriver, have configured it in the path environment variable and check the box “Use Firefox instead of Chrome” However, we highly recommend you use Chrome instead (or as well), as the recording functions are not enabled for Firefox browser.
7. Other Shortcuts¶
- In Script Editor and Log Viewer, use
Ctrl + mousewheel to freely change the font size.
- In Script Editor, you can use
Ctrl + Fto search.
- In Script Editor, you can use
Ctrl + /to comment/uncomment.
- When you switch Poco mode, it will prompt you to insert code. To confirm the mode, please click Yes.
- In Poco assistance window, use
Ctrl + Fto hide/show UI search box.