出现以下提示,按照上图点击YES就行啦!别问我什么意思,我也不知道!哈哈!
Poco mode has changed. Do you want to insert poco init code at the current cursor position? Yes No点击Yes以后脚本区域会自动导入Poco需要的包:
from poco.drivers.android.uiautomation import AndroidUiautomationPoco poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)在安装插件Yosemite和PocoService出现以下提示,直接忽略风险即可。
没多大的风险,顶多盗取你几个亿,哈哈,因为不装这个服务用不了!你用不了!
脚本录入步骤基本上一样,点击IDE窗口左侧的Poco Assistant下方最右侧的录制按钮,然后手动操作步骤,IDE会自动记录识别的脚本;
脚本录入完成,详细代码如下所示:
# -*- encoding=utf8 -*- # # Altumn __author__ = "Altumn" from airtest.core.api import * auto_setup(__file__) from poco.drivers.android.uiautomation import AndroidUiautomationPoco poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False) poco(text="微信").click() poco("搜索").click() poco("com.tencent.mm:id/h1").click() text("testclass") poco(boundsInParent="[0.34814814814814815, 0.033854166666666664]").click() poco(text="一个").click() poco("com.tencent.tbs.core.webkit.WebView").click() poco("com.tencent.tbs.core.webkit.WebView").swipe([-0.0734, -0.4783]) poco("com.tencent.tbs.core.webkit.WebView").swipe([0.0056, -0.6197]) poco("com.tencent.tbs.core.webkit.WebView").swipe([0.0904, -0.8056]) poco("com.tencent.tbs.core.webkit.WebView").swipe([0.0254, -0.7722]) poco("com.tencent.tbs.core.webkit.WebView").click() poco("com.tencent.tbs.core.webkit.WebView").click() poco("com.tencent.tbs.core.webkit.WebView").click() poco("com.tencent.tbs.core.webkit.WebView").swipe([0.1215, -0.7452]) poco("com.tencent.tbs.core.webkit.WebView").click()