Code Monkey home page Code Monkey logo

fautotest's Introduction

FAutoTest

一个 H5、小程序自动化测试框架

简介

随着产品业务形态逐渐从 App 延升到微信小程序、微信公众号以及 QQ公众号等,而之前的自动化建设主要是 Native App 为主,全手工测试已无法满足快速增长的业务需求。为提升测试效率和质量,FAutoTest 框架致力于解决 QQ、微信内 UI 的自动化问题(包括微信内 H5页面和小程序、QQ 内 H5页面),提升自动化测试的效率和稳定性。

FAutoTest 是一款成长中的框架,吸收借鉴了一些 UI 自动化工具的优秀设计理念和**。如果框架有不足地方,或者你有更好的建议,欢迎提交 Issues 参与贡献。

特性

FAutoTest 专业服务于微信 H5/小程序的UI自动化测试,提升测试效率与质量。

  • 支持微信 H5页面,能识别常见 H5控件,能获取页面任意内容(常见的如文字、图片、链接等)
  • 支持小程序内控件识别,操作,页面内容获取等
  • 支持安卓 Native 页面组合操作使用
  • 简单的 API 设计,较低的使用门槛
  • 支持基础的性能测试监控
  • 功能扩展性强,扩展门槛低

架构

  1. 整体采用分层设计,API设计方式参考 WebDriver

  2. 整体框架是一个同步阻塞的模型:在一个线程中循环的执行 receive 方法,等待收到 response,发送消息后,阻塞,只有当 receive 方法获得消息时,才会解除阻塞,发送下一条消息,具备超时异常处理机制

  3. 框架内打包了 Python 版本的 UIAutomator,方便在安卓 Native 页面进行操作

User Interface(用户交互层): 提供给用户所有的界面操作 API(H5界面及小程序界面),使用者不需要关注框架内部实现,只需要关注自身业务逻辑流程(手工用例流程转换成自动化流程)

PageOperator(操作解析层): 主要用于接收和解析用户命令后传递给下层 Engine 层

Engine( H5&小程序引擎层): 将用户命令传输到手机,并返回结果信息。封装 WebSocket 和单线程池,通过WebSocket Debug URL 和浏览器内核建立链接,发送 Json 格式的协议到手机端进行用户指定的操作。

业务流程

  • H5页面/小程序 UI 自动化执行流程

  • 自动化脚本调用流程

依赖软件环境

软件 软件要求
Python 版本 2.7.x 版本
Java JDK 版本 Java 语言框架(最低1.7)
Android SDK 版本 4.4 及以上版本
adb 版本 最新版本即可
Python IDE 开发环境 如 PyCharm CE等

1. Python 版本安装

下载 & 安装 Python,安装后在终端输入命令 python -vpip list,能够执行,说明 Python 环境配置成功。

2. Java JDK 版本安装

下载 & 安装 Java JDK 安装后在终端输入命令java -versionjava, javac命令能够执行,则 Java 环境配置成功。

3. Android SDK 版本安装

下载 & 安装 Android Studio,然后在里面安装 Android SDK

4. 配置 adb 环境

安装 Android Studio 后,配置 SDK 环境(若自动安装不成功,可到手动下载安装 ,安装后在终端输入命令 adb version 执行有结果,则说明配置成功

5. IDE 安装

下载 & 安装 Pycharm CE

FAutoTest 开发环境安装

库名称 版本 下载地址
uiautomator 0.3.2 https://pypi.org/project/uiautomator/#files
lxml 4.2.3 https://pypi.org/project/lxml/4.2.3/#files
bidict 0.17.0 https://pypi.org/project/bidict/#files
websocket-client 0.44.0 https://pypi.org/project/websocket-client/#files
  • 使用pip安装框架所需的第三方库 uiautomatorwebsocket-clientlxmlbidict,如安装lxmlbidictwebsocket-client可用pip形式安装,如安装lxml

    pip install lxml
    
  • 安装自身框架

    pip install dist/fastAutoTest-xxx.whl(whl文件请在dist目录下手动下载)
    
  • 打开微信Debug模式,安装 TBS 内核

使用方式

如何写测试案例,如微信 H5页面,如下所示:

# coding=utf-8
from fastAutoTest.core.h5.h5Engine import H5Driver

# http://h5.baike.qq.com/mobile/enter.html 从微信进入此链接,首屏加载完后执行脚本
if __name__ == '__main__':
    h5Driver = H5Driver()
    h5Driver.initDriver()
    h5Driver.clickElementByXpath('/html/body/div[1]/div/div[3]/p')
    h5Driver.clickFirstElementByText('白内障')
    h5Driver.returnLastPage()
    h5Driver.returnLastPage()
    print(h5Driver.getElementTextByXpath('/html/body/div[1]/div/div[3]/p'))
    h5Driver.close()
  1. 从微信初始化 H5页面,如进入 http://h5.baike.qq.com/mobile/enter.html
  2. 进入页面后找到需要操作的控件的xpath,可通过 chrome:inspect 找到当前页面,找到控件的xpath
  3. 初始化框架并进行 API 调用,如执行点击控件等
  4. 关闭框架,执行用例

QQ 的 H5页面:

# coding=utf-8
from fastAutoTest.core.qq.qqEngine import QQDriver

# 从动态 -> 动漫进入
if __name__ == '__main__':
    qqDriver = QQDriver()
    qqDriver.initDriver()
    qqDriver.clickFirstElementByText('英雄救美,这也太浪漫了')
    qqDriver.returnLastPage()
    qqDriver.clickElementByXpath('//*[@id="app"]/div/ul/li[2]')
    qqDriver.returnLastPage()
    qqDriver.close()
  1. 从 QQ 动态,进入动漫 H5页面
  2. 找到需操作的控件的xpath,可通过 chrome:inspect 找到当前页面,找到控件的xpath
  3. 初始化框架并进行相关 API 调用
  4. 关闭框架,执行用例

微信小程序:

# coding=utf-8
from fastAutoTest.core.wx.wxEngine import WxDriver
import os

# 进入企鹅医典小程序
if __name__ == '__main__':
    wxDriver = WxDriver()
    wxDriver.initDriver()
    # 点击全部疾病
    wxDriver.clickElementByXpath('/html/body/div[1]/div/div[3]/p')
    wxDriver.clickFirstElementByText('白内障')
    wxDriver.returnLastPage()
    wxDriver.returnLastPage()
    # 截图
    dirPath = os.path.split(os.path.realpath(__file__))[0]
    PIC_SRC = os.path.join(dirPath, 'pic.png')
    wxDriver.d.screenshot(PIC_SRC)
    wxDriver.close()
  1. 搜索小程序,如企鹅医典小程序,进入小程序页面
  2. 同样找控件的xpath,同上操作
  3. 初始化框架,进行相关 API 调用
  4. 关闭框架,执行用例

后期计划

改造FAutoTest,兼容QT4W,实现FAutoTest到QTA的无缝切换。

交流群

交流群,请扫码加入下面群,验证回复 FAutoTest 按照指引进群。

相关链接

CONTRIBUTING

IFRAME

NOTICES

APPENDIX

APIs

QA

贡献代码

如果你在使用过程中发现 Bug,请通过 Issues 或 Pull Requests 来提交反馈,或者加入交流群来解决。
首次参与贡献请阅读:CONTRIBUTING

腾讯开源激励计划 鼓励开发者的参与和贡献,期待你的加入。

License

所有代码采用 BSD-3-Clause License 开源

fautotest's People

Contributors

chrisdimion avatar lucianliu6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fautotest's Issues

可以增加支持企业微信么?

目前有项目在使用企业微信的开发,但是今天试了一下还不能支持企业微信,这个是因为企业微信本身的问题么?

建议把 weixin.apk 放到其它地方,不要放在仓库中,会导致 clone 仓库的时候巨慢

建议把 /docs/assert/weixin663android1260.apk 这个 apk 独立出来放到一些在线云存储上去,不然 clone 仓库的时候可能会由于 git-lfs 导致速度很慢
我这边在本地 clone 的速度只有 20kb/s...
只不过放进去之后要再拿出来感觉会比较麻烦,而且这个 apk 还是和其它文件一起在 a0a065b 第一个 commit 提交上去的,有点难分离...

环境搭建的问题

怎么样才能安装成功这个fauto,我这边不知道whl文件是怎么弄的

小米手机无法获取进程ID问题及解决方案

image

问题在于这个adb命令获取的是MIUI桌面的activity 的PID

试了下 adb shell dumpsys activity top | findstr com.tencent.mm,可以拿到,可以考虑针对这种情况优化一下获取PID的策略

Mate 10 几个问题

1.每次运行脚本都会弹出安装uiautomator 和 uiautomator.test ,要怎么设置
2.下列脚本报错,要怎么修改?
from fastAutoTest.core.h5.h5Engine import H5Driver
import os
import time
'''
打开Android微信,利用ADB命令
'''
def openWechat():
os.system('adb shell am force-stop com.tencent.mm') # 杀掉微信
os.system('adb shell am start com.tencent.mm/.ui.LauncherUI') # 启动微信
time.sleep(15)
'''
H5页面操作
'''
def pageOperator(url,h5Driver):
h5Driver.navigateToPage(url)
#print("手机屏幕高度%s,手机屏幕宽带%s" % (h5Driver.getWindowHeight(),h5Driver.getWindowWidth()))
#print("H5页面CPU %s,内存信息%s" % (h5Driver.getCPUInfo(),h5Driver.getMemoryInfo()))
#while not h5Driver.isElementExist('.//*[text()="建寺功德"]'):
time.sleep(10)
h5Driver.returnLastPage()

def main_work():
openWechat()
h5Driver = H5Driver()
h5Driver.initDriver()
url = 'https://ecsp.icbc.com.cn/wechat_official_account/payWX/payIndex.html?code=0819ZC1b0GIlCv1FD11b0xEQ1b09ZC1V&parabcode=DZYH&openId=oWX3XjgdG3SWaFTos5oV0h5tDZ5c&k=ECSP&wechatOfficialAcct=wx1ec46f7d85a521b1&parabcode=DZYH&skinType=standard&code=0819ZC1b0GIlCv1FD11b0xEQ1b09ZC1V&state=icbc&token=oWX3XjgdG3SWaFTos5oV0h5tDZ5c'
pageOperator(url,h5Driver)
h5Driver.close()

if name == 'main':
main_work()

报错:
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.tencent.mm/.ui.LauncherUI }
Traceback (most recent call last):
File "", line 1, in
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Users/kfzx-yanyj/Documents/PythonWorkSpace/FAutoTest/H5Test.py", line 35, in
main_work()
File "/Users/kfzx-yanyj/Documents/PythonWorkSpace/FAutoTest/H5Test.py", line 29, in main_work
h5Driver.initDriver()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fastAutoTest/core/h5/h5Engine.py", line 63, in initDriver
url = self._urlFetcher.fetchWebSocketDebugUrl()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fastAutoTest/core/h5/h5WebSocketDebugUrlFetcher.py", line 30, in fetchWebSocketDebugUrl
self._fetchInner()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fastAutoTest/core/h5/h5WebSocketDebugUrlFetcher.py", line 48, in _fetchInner
self._webSocketDebugUrl = self._fetchWebSocketDebugUrl(self._localForwardPort)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fastAutoTest/core/h5/h5WebSocketDebugUrlFetcher.py", line 155, in _fetchWebSocketDebugUrl
raise RuntimeError(errorMsg)
RuntimeError: 在执行脚本前,先进入H5页面

print() is a function and reload() is no longer a builtin in Python 3

458 days until Python 2 end of life.

flake8 testing of https://github.com/Tencent/FAutoTest on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./fastAutoTest/core/wx/wxEngine.py:32:1: F821 undefined name 'reload'
reload(sys)
^
./fastAutoTest/core/wx/wxWebSocketDebugUrlFetcher.py:270:34: E999 SyntaxError: invalid syntax
                print webSocketUrl
                                 ^
./fastAutoTest/core/common/network/shortLiveWebSocket.py:108:40: E999 SyntaxError: invalid syntax
                    print 'already quit'
                                       ^
./fastAutoTest/core/h5/h5PageOperator.py:57:23: F821 undefined name 'unicode'
        unicodeText = unicode(text, 'utf-8')
                      ^
./fastAutoTest/core/h5/h5Engine.py:37:1: F821 undefined name 'reload'
reload(sys)
^
./fastAutoTest/core/qq/qqEngine.py:31:1: F821 undefined name 'reload'
reload(sys)
^
./fastAutoTest/utils/commandHelper.py:36:13: E999 SyntaxError: invalid syntax
    print out
            ^
3     E999 SyntaxError: invalid syntax
4     F821 undefined name 'reload'
7

h5Driver.isElementExist根据xpath获取元素,xpath expression 无效导致异常,api返回查找元素结果为True

代码部分,如下has_all_tab_cur 结果为true,实际看了日志才发现其实是没有找到元素的。

all_tab_xpath` = './/*[text()="所有订单"'
has_all_tab_cur = h5Driver.isElementExist(all_tab_xpath)

C:\Python27\Lib\site-packages\fastAutoTest\core\h5\h5Engine.py 方法 isElementExist 增加resultValueDict = self._networkHandler.send(getExistCmd).getResponse()[0]结果打印

        resultValueDict = self._networkHandler.send(getExistCmd).getResponse()[0]
        self.logger.debug("resultValueDict: {resultValueDict}".format(resultValueDict=resultValueDict))
        resultType = resultValueDict['result']['result']['subtype']
        num = 0
        while resultType == 'null' and num < 3:
            self.wait(WAIT_REFLESH_2_SECOND)
            getExistCmd = self._pageOperator.isElementExist(xpath, contextId)
            resultValueDict = self._networkHandler.send(getExistCmd).getResponse()[0]
            resultType = resultValueDict['result']['result']['subtype']
            num = num + 1
        return resultType != 'null'

日志:

[2018-11-02 18:21:12,907] [pid:5688] [h5Engine.py:478] [isElementExist] DEBUG: resultValueDict: {u'result': {u'exceptionDetails': {u'columnNumber': 53, u'exception': {u'className': u'DOMException', u'subtype': u'error', u'type': u'object', u'description': u'DOMException: Failed to execute \'evaluate\' on \'Document\': The string \'.//*[text()="\u6240\u6709\u8ba2\u5355"\' is not a valid XPath expression.\n    at <anonymous>:1:54', u'objectId': u'{"injectedScriptId":7,"id":2}'}, u'text': u'Uncaught', u'exceptionId': 1, u'scriptId': u'317', u'lineNumber': 0}, u'result': {u'className': u'DOMException', u'subtype': u'error', u'type': u'object', u'description': u'DOMException: Failed to execute \'evaluate\' on \'Document\': The string \'.//*[text()="\u6240\u6709\u8ba2\u5355"\' is not a valid XPath expression.\n    at <anonymous>:1:54', u'objectId': u'{"injectedScriptId":7,"id":1}'}}}
True

分析:
resultValueDict 返回结果的json数据如下,其中 resultValueDict['result']['result']['subtype']值为‘error’。源码中只判断了resultType != 'null',导致返回结果为true。使用者在未打开日志的场景下,并不知道自己的xpath expression 是错误的,还以为是找到了元素,这对结果的判断是不准确的。

{
	u 'result': {
		u 'exceptionDetails': {
			u 'columnNumber': 53,
			u 'exception': {
				u 'className': u 'DOMException',
				u 'subtype': u 'error',
				u 'type': u 'object',
				u 'description': u 'DOMException: Failed to execute \'evaluate\' on \'Document\': The string \'.//*[text()="\u6240\u6709\u8ba2\u5355"\' is not a valid XPath expression.\n    at <anonymous>:1:54',
				u 'objectId': u '{"injectedScriptId":7,"id":2}'
			},
			u 'text': u 'Uncaught',
			u 'exceptionId': 1,
			u 'scriptId': u '317',
			u 'lineNumber': 0
		},
		u 'result': {
			u 'className': u 'DOMException',
			u 'subtype': u 'error',
			u 'type': u 'object',
			u 'description': u 'DOMException: Failed to execute \'evaluate\' on \'Document\': The string \'.//*[text()="\u6240\u6709\u8ba2\u5355"\' is not a valid XPath expression.\n    at <anonymous>:1:54',
			u 'objectId': u '{"injectedScriptId":7,"id":1}'
		}
	}
}

运行damo报错

运行H5demo报错
websocket._exceptions.WebSocketConnectionClosedException: socket is already closed.

H5demo报错

_fetchWebSocketDebugUrl
raise RuntimeError(errorMsg)
RuntimeError: 无法获取debug url,并检查是否配置了代理,是否已经建立了websocket连接未关闭

scrollWindow关键字,未支持传坐标(px)滑动

问题表现:

使用scrollWindow做滑动操作,传坐标值:scrollWindow(700,700,100,100,80),程序日志卡在scrollWindow处,小程序的表现为 自动退出小程序

用官方提供的关键字getWindowHeight getWindowWidth或得到屏幕的宽度、高度分别为612,,394(px/(dpi/160))的结果:
image
改滑动操作为scrollWindow(200,200,50,50,80) 即x,y值均在windowWidth windowHeight之内,滑动操作可以正常执行;

附上屏幕分辨率和dpi信息如下:

image

是否可用提供端口和环境

微信小程序测试现在一直是在真机上,现在微信小程序开发越来越多,像这样一个基于WebDriver框架的python程序,来应用在真机上面进行测试,其实完全没有给出预期的解决方案。仅仅在真机上用WebDriver进行测试,绝大多数公司都能做,并不解决痛点。微信小程序测试要解决的痛点,是在微信账号和真机有限的情况下,如何部署数十甚至几十个微信小程序的自动化测试。
希望tx给出新的测试环境,类似于小程序开发者工具那种IDE,只不过这个环境是用于测试的,让微信小程序测试不必依赖微信,提供一个微信虚拟机环境,这样能够真实的解决小程序测试痛点。如果能在DockerHub上提供微信虚拟机环境的Docker,那就功德无量了。
而这个仓库所提供的FAutoTest,价值真的太低了。

执行H5demo报错找不到微信Tools进程,如何解决,也获取不到pid

执行H5Demo错误日志如下:
Error in sys.excepthook:
Traceback (most recent call last):
File "/Users/ios3rd/Desktop/Test/Tools/FAutoTest-master/fastAutoTest/utils/vmhook.py", line 48, in _handleUncaughtException
raise Exception(exctype)
Exception: <type 'exceptions.RuntimeError'>

Original exception was:
Traceback (most recent call last):
File "/Users/ios3rd/Desktop/Test/Tools/FAutoTest-master/sample/H5Demo.py", line 17, in
h5Driver.initDriver()
File "/Users/ios3rd/Desktop/Test/Tools/FAutoTest-master/fastAutoTest/core/h5/h5Engine.py", line 70, in initDriver
url = self._urlFetcher.fetchWebSocketDebugUrl()
File "/Users/ios3rd/Desktop/Test/Tools/FAutoTest-master/fastAutoTest/core/h5/h5WebSocketDebugUrlFetcher.py", line 37, in fetchWebSocketDebugUrl
self._fetchInner()
File "/Users/ios3rd/Desktop/Test/Tools/FAutoTest-master/fastAutoTest/core/h5/h5WebSocketDebugUrlFetcher.py", line 49, in _fetchInner
pid = H5WebSocketDebugUrlFetcher._fetchWeixinToolsProcessPid(device=self._device)
File "/Users/ios3rd/Desktop/Test/Tools/FAutoTest-master/fastAutoTest/core/h5/h5WebSocketDebugUrlFetcher.py", line 88, in _fetchWeixinToolsProcessPid
raise RuntimeError(errorMsg)
RuntimeError: 找不到微信Tools进程

小程序底部菜单栏识别不到

小程序名字:小宇宙Heli
该小程序首页正常页面如下:
image
但是在chrome://inspect调试页面打开如下,发现底部的菜单栏显示不出来,试过另外几个页面,打开均空白。
image
请问是什么原因呢?应该要怎样解决?

demo运行小程序的时候报错

from fastAutoTest.core.wx.wxEngine import WxDriver
import os

进入企鹅医典小程序

if name == 'main':
wxDriver = WxDriver()

wxDriver.initDriver()
# 点击全部疾病
wxDriver.clickElementByXpath('/html/body/div/div[1]/div[2]/div[1]/a')
wxDriver.clickFirstElementByText('肺癌')
wxDriver.returnLastPage()
wxDriver.returnLastPage()
# 截图
dirPath = os.path.split(os.path.realpath(__file__))[0]
PIC_SRC = os.path.join(dirPath, 'pic.png')
wxDriver.d.screenshot(PIC_SRC)
wxDriver.close()

上面是demo中运行小程序的代码,我连接了OPPO手机之后,先打开了腾讯医典,然后运行代码,但是报错如下:
Traceback (most recent call last):
File "C:/Users/charles/Downloads/FAutoTest-master/FAutoTest-master/sample/XcqDemo.py", line 17, in
wxDriver.initDriver()
File "C:\Users\charles\Downloads\FAutoTest-master\FAutoTest-master\fastAutoTest\core\wx\wxEngine.py", line 64, in initDriver
url = self._urlFetcher.fetchWebSocketDebugUrl()
File "C:\Users\charles\Downloads\FAutoTest-master\FAutoTest-master\fastAutoTest\core\wx\wxWebSocketDebugUrlFetcher.py", line 64, in fetchWebSocketDebugUrl
self._fetchInner()
File "C:\Users\charles\Downloads\FAutoTest-master\FAutoTest-master\fastAutoTest\core\wx\wxWebSocketDebugUrlFetcher.py", line 77, in _fetchInner
pid = WxWebSocketDebugUrlFetcher._fetchWeixinToolsProcessPid(device=self._device)
File "C:\Users\charles\Downloads\FAutoTest-master\FAutoTest-master\fastAutoTest\core\wx\wxWebSocketDebugUrlFetcher.py", line 100, in _fetchWeixinToolsProcessPid
raise RuntimeError(errorMsg)
RuntimeError: 获取小程序pid失败,请检查是否在小程序首屏进行初始化

我一段一段代码进行排查之后,发现wxWebSocketDebugUrlFetcher.py,这个文件中会在cmd中运行一串命令adb shell cat /proc/net/unix | findstr webview_devtools_remote_%s

而代码中是这么写的:
webviewCmd = _ADB_GET_WEBVIEW_TOOLS_CMD[osName] % (pid)
# 验证是否启动了小程序webview
try:
webStdout, webStdError = runCommand(AdbHelper.specifyDeviceOnCmd(webviewCmd, device))
print("--------"+webStdout)
except:
print("出错")
errorMsg = ErrorMsgManager().errorCodeToString(ERROR_CODE_NOT_ENTER_XCX)
raise RuntimeError(errorMsg)
return pid

也就是说运行这个命令错误,直接抛出异常的。
这个命令在你的INITERROR.md中并没有提到,我想问一下这个应该怎么解决呢?
能否不运行,直接把split得到的pid直接返回回去呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.