Appium Appium 切换到 WebView 后不执行 find_element 命令

jack · 2015年11月24日 · 最后由 顾翔 回复于 2018年05月15日 · 1837 次阅读

测试对象是微信公众号
贴上脚本代码:

#coding=utf-8
import unittest
from appium import webdriver
#By定义了若干查找控件的方法
from appium.webdriver.mobilecommand import MobileCommand
from selenium.webdriver.common.by import By
from appium.webdriver.common.touch_action import TouchAction
from time import sleep
from appium import webdriver
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

class Testsuit(unittest.TestCase):
    def setUp(self):
        desired_caps = {}
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.0.1'
        desired_caps['deviceName'] = 'note4'
        desired_caps['appPackage'] = 'com.tencent.mm'
        desired_caps['appActivity'] = '.ui.LauncherUI'
        desired_caps['newCommandTimeout'] = '15'
        desired_caps['unicodeKeyboard'] = 'True'
        desired_caps['resetKeyboard'] = 'True'
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
        self.driver.implicitly_wait(time_to_wait="15")

    def tearDown(self):
        self.driver.quit()

    def test_OpenYoWe(self):
        self.driver.find_element(by=By.NAME, value="通讯录").click()
        self.driver.find_element(by=By.NAME, value="公众号").click()
        self.driver.find_element(by=By.NAME, value="测试").click()
        self.driver.find_element(by=By.NAME, value="页面").click()#点击后进入公众号的页面
        print self.driver.contexts#打印WebView页面
        sleep(5)
        self.driver.execute(MobileCommand.SWITCH_TO_CONTEXT, {"name": "WEBVIEW_com.tencent.mm:tools"})#切换到对应的WebView页面
        self.driver.find_element_by_xpath("html/body/div/div[1]/div/ul[2]/li[1]/div[2]/div[2]/div/button").click()#查找WebView元素

if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(Testsuit)
    unittest.TextTestRunner(verbosity=2).run(suite)

这是运行后的 Log

> info: [debug] Getting a list of available webviews
> info: [debug] executing cmd: D:\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "cat /proc/net/unix"
> info: [debug] WEBVIEW_2949 mapped to pid 2949
> info: [debug] Getting process name for webview
> info: [debug] executing cmd: D:\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "ps"
> info: [debug] Parsed pid: 2949 pkg: com.tencent.mm:tools
> info: [debug] from: u0_a47,2949,148,1688764,158084,ffffffff,b7724251,R,com.tencent.mm:tools
> info: [debug] returning process name: com.tencent.mm:tools
> info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.tencent.mm:tools
> info: [debug] ["WEBVIEW_com.tencent.mm:tools"]
> info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.tencent.mm:tools
> info: [debug] Connecting to chrome-backed webview
> info: Chromedriver: Changed state to 'starting'
> info: Chromedriver: Set chromedriver binary as: D:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
> info: Chromedriver: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
> info: Chromedriver: Successfully cleaned up old chromedrivers
> info: Chromedriver: Spawning chromedriver with: D:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515
> info: Chromedriver: [STDOUT] Starting ChromeDriver 2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067) on port 9515
> Only local connections are allowed.
> info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Windows NT","version":"6.1 SP1"}}}
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidDeviceSerial":"127.0.0.1:62001"}}}
> info: [debug] Didn't get a new command in 15 secs, shutting down...
> info: Shutting down appium session
> info: [debug] Pressing the HOME button

提问:

info: Chromedriver: Changed state to 'starting'可以看出已经切换到 WebView 页面去了
但是后面没有执行 self.driver.find_element_by_xpath("html/body/div/div[1]/div/ul[2]/li[1]/div[2]/div[2]/div/button").click()# 查找 WebView 元素
想请问下 Appium 切换到 WebView 后的运行机制是什么?

共收到 20 条回复 时间 点赞

. 很明显的问题。。

{"name": "u'WEBVIEW_com.tencent.android.qqdownloader'"} 

你为什么要加 u''呢
改成

{"name": "WEBVIEW_com.tencent.android.qqdownloader"}

python 中 unicode string 写法是:

u"String"

不是

"u'String'"

话说微信的 webview 现在能获取到了?

#1 楼 @zsx10110

> info: [debug] Getting a list of available webviews
> info: [debug] executing cmd: D:\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "cat /proc/net/unix"
> info: [debug] WEBVIEW_5542 mapped to pid 5542
> info: [debug] Getting process name for webview
> info: [debug] executing cmd: D:\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "ps"
> info: [debug] Parsed pid: 5542 pkg: com.tencent.mm:tools
> info: [debug] from: u0_a47,5542,147,1665296,132748,ffffffff,b767f01b,S,com.tencent.mm:tools
> info: [debug] returning process name: com.tencent.mm:tools
> info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.tencent.mm:tools
> info: [debug] ["WEBVIEW_com.tencent.mm:tools"]
> info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.tencent.mm:tools
> info: [debug] Connecting to chrome-backed webview
> info: Chromedriver: Changed state to 'starting'
> info: Chromedriver: Set chromedriver binary as: D:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
> info: Chromedriver: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
> info: Chromedriver: Successfully cleaned up old chromedrivers
> info: Chromedriver: Spawning chromedriver with: D:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515
> info: Chromedriver: [STDOUT] Starting ChromeDriver 2.20.353145 (343b531d31eeb933ec778dbcf7081628a1396067) on port 9515
> Only local connections are allowed.
> info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Windows NT","version":"6.1 SP1"}}}
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.tencent.mm","androidUseRunningApp":true,"androidDeviceSerial":"127.0.0.1:62001"}}}
> info: [debug] Didn't get a new command in 15 secs, shutting down...
> info: Shutting down appium session

貌似没有执行查找元素的这一步
self.driver.find_element_by_xpath("html/body/div/div[1]/div/ul[2]/li[1]/div[2]/div[2]/div/button").click()

#3 楼 @x746560359 看 log 确实是没执行你那句话,能提供下源代码吗?另外问题跟楼上一样,现在可以测试微信的 webview 了?求指导下。

self.driver.execute(MobileCommand.SWITCH_TO_CONTEXT, {"name": "WEBVIEW_com.cvte.webviewtest"})#切换到对应的WebView页面
self.driver.find_element_by_id("word").send_keys("ss")

上面是我测试一个简单的 webview 首页是百度的应用 是没问题 能够执行的。

#4 楼 @zsx10110
contexts 打印出来的是 [u'NATIVE_APP', u'WEBVIEW_com.tencent.mm:tools']
你可以在下面的代码里增加步骤打开一个公众号页面
微信是不是要安装 TBS 打开调试页面才可以?

#coding=utf-8
import unittest
from appium import webdriver
#By定义了若干查找控件的方法
from appium.webdriver.mobilecommand import MobileCommand
from selenium.webdriver.common.by import By
from appium.webdriver.common.touch_action import TouchAction
from time import sleep
from appium import webdriver
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
#点击坐标
#self.driver.tap([(810,1210)])
#混合输入
#self.driver.find_element(by=By.CLASS_NAME, value="android.widget.EditText").send_keys(u"去玩儿123qwert~!@#$%^&*()_+")

class Testsuit(unittest.TestCase):
    def setUp(self):
        desired_caps = {}
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '5.0.1'
        desired_caps['deviceName'] = 'note4'
        desired_caps['appPackage'] = 'com.tencent.mm'
        desired_caps['appActivity'] = '.ui.LauncherUI'
        desired_caps['newCommandTimeout'] = '15'
        desired_caps['unicodeKeyboard'] = 'True'
        desired_caps['resetKeyboard'] = 'True'
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
        self.driver.implicitly_wait(time_to_wait="15")

    def tearDown(self):
        self.driver.quit()

    def test_OpenYouWei(self):
        self.driver.find_element(by=By.NAME, value="通讯录").click()
        self.driver.find_element(by=By.NAME, value="公众号").click()
        print self.driver.contexts
        sleep(5)
        self.driver.execute(MobileCommand.SWITCH_TO_CONTEXT, {"name": "WEBVIEW_com.tencent.mm:tools"})
        self.driver.find_element_by_xpath("html/body/div/div[1]/div/ul[2]/li[1]/div[2]/div[2]/div/button").click()

if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(Testsuit)
    unittest.TextTestRunner(verbosity=2).run(suite)

#5 楼 @x746560359 试了下 我用微信只能显示 NATIVE_APP,你那里为什么可以显示 webview 另外 tbs 是啥东西。。

#6 楼 @zsx10110
我加你 QQ 吧,告诉我

8楼 已删除

@zsx10110 @x746560359
我的 QQ 号是 348940981,最近在研究如何在手机上识别 WebView 元素,我用最新的 Appium Inspector 查看天猫 Apk,点击 Refresh,通过日志发现它把 apk 做了 debug 重签名,然后调用了 Bootstrap 里面的 source 命令,在 Inspector 的界面上就可以看到当前 App 页面的控件树。
想请教大家,Refresh 操作是通过 source 实现的吗?能够直接获取到 WebView 的内容?
https://github.com/appium/appium/blob/master/lib/devices/android/android-hybrid.js又在什么时候起的作用呢?
最重要的问题是不依赖 PC 端的 chromedriver,能直接在手机端获取 WebView 元素么?
还请大家不吝赐教,谢谢了!

@x746560359 微信的 webview,我手机装了 TBS,使用 UI Automator view,第一次只能得到 webview,第二次再获得 screenShot 能得到页面元素,但使用 appium,只能得到 NATIVE_APP

11楼 已删除

@x746560359 这个问题你解决了吗。碰到同样的问题

#7 楼 @x746560359 我也只能获取 NATIVE_APP,获取不到 webview,求指教~QQ;153388059

请问楼主,这个问题最后解决了吗
我也遇到相同的问题了

同样的问题,一直没解决

获取不到 webview 是应为没有获取 web 权限,需要开发在代码初始化的时候添加代码:


if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {    
    WebView.setWebContentsDebuggingEnabled(true);
    }

另外我遇到一个问题。。。已经切换到 webview,无法操作滑动。。。。

楼主问题解决了吗,我也遇到相同问题了

> info: [debug] Responding to client with success: {"status":0,"value":["NATIVE_APP","WEBVIEW_com.android.browser"],"sessionId":"ce0c9924-6801-4e8d-88e6-d423d93a29e9"}
> info: <-- GET /wd/hub/session/ce0c9924-6801-4e8d-88e6-d423d93a29e9/contexts 200 285.910 ms - 116 {"status":0,"value":["NATIVE_APP","WEBVIEW_com.android.browser"],"sessionId":"ce0c9924-6801-4e8d-88e6-d423d93a29e9"}
> info: --> POST /wd/hub/session/ce0c9924-6801-4e8d-88e6-d423d93a29e9/context {"sessionId":"ce0c9924-6801-4e8d-88e6-d423d93a29e9","name":"WEBVIEW_com.android.browser"}
> info: [debug] Getting a list of available webviews
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s a8e34a88 shell "cat /proc/net/unix"
> info: [debug] WEBVIEW_16148 mapped to pid 16148
> info: [debug] Getting process name for webview
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s a8e34a88 shell "ps"
> info: [debug] Parsed pid: 16148 pkg: com.android.browser
> info: [debug] from: u0_a3,16148,265,1183056,169020,ffffffff,00000000,S,com.android.browser
> info: [debug] returning process name: com.android.browser
> info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.android.browser
> info: [debug] ["WEBVIEW_com.android.browser"]
> info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.android.browser
> info: [debug] Connecting to chrome-backed webview
> info: Chromedriver: Changed state to 'starting'
> info: Chromedriver: Set chromedriver binary as: D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe
> info: Chromedriver: Killing any old chromedrivers, running: FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"9515 "`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I chromedriver.exe`) do (IF NOT %b=="" TASKKILL /F /PID %a))
> info: Chromedriver: No old chromedrivers seemed to exist
> info: Chromedriver: Spawning chromedriver with: D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win\chromedriver.exe --url-base=wd/hub --port=9515
> info: Chromedriver: [STDOUT] Starting ChromeDriver 2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a) on port 9515
> Only local connections are allowed.
> info: JSONWP Proxy: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body
> info: JSONWP Proxy: Got response with status 200: "{\"sessionId\":\"\",\"status\":0,\"value\":{\"build\":{\"version\":\"alpha\"},\"os\":{\"arch\":\"x86_64\",\"name\":\"Windows NT\",\"version\":\"6.1 SP1\"}}}"
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.wuba.zhuanzhuan","androidUseRunningApp":true,"androidDeviceSerial":"a8e34a88"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"48484bae5d2a8561bcd0432883fe3697","status":13,"value":{"message":"unknown error: Device a8e34a88 is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d...
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.wuba.zhuanzhuan","androidUseRunningApp":true,"androidDeviceSerial":"a8e34a88"}}}
> info: [debug] Didn't get a new command in 60 secs, shutting down...
> info: Shutting down appium session
> info: [debug] Pressing the HOME button
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s a8e34a88 shell "input keyevent 3"
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
> info: [debug] [BOOTSTRAP] [debug] Closed client connection
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 90.544
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] UiAutomator shut down normally
> info: [debug] Cleaning up android objects
> info: [debug] Cleaning up appium session
> info: [debug] We shut down because no new commands came in
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"2392b916ac64c4a5fb5c5ee182d301da","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=W...
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.wuba.zhuanzhuan","androidUseRunningApp":true,"androidDeviceSerial":"a8e34a88"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"f96bb09622ccbf6ec8d182190fab036a","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=W...
> info: JSONWP Proxy: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.wuba.zhuanzhuan","androidUseRunningApp":true,"androidDeviceSerial":"a8e34a88"}}}
> info: JSONWP Proxy: Got response with status 200: {"sessionId":"85cb8cefcac0c27066cfb91e157b5589","status":13,"value":{"message":"unknown error: Device a8e34a88 is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d...
> error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM
> info: Chromedriver: Changed state to 'stopped'
> warn: Chromedriver for context WEBVIEW_com.android.browser stopped unexpectedly
> warn: Chromedriver quit unexpectedly, but it wasn't the active context, ignoring
> error: Chromedriver: Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device a8e34a88 is not online
>   (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))
>     at JWProxy.command$ (lib/proxy.js:133:15)
>     at tryCatch (D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:67:40)
>     at GeneratorFunctionPrototype.invoke [as _invoke] (D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:315:22)
>     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:100:21)
>     at GeneratorFunctionPrototype.invoke (D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\regenerator\runtime.js:136:37)
>     at bound (domain.js:284:14)
>     at GeneratorFunctionPrototype.runBound (domain.js:297:12)
>     at run (D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:89:39)
>     at D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\es6.promise.js:100:28
>     at flush (D:\appium\Appium\node_modules\appium\node_modules\appium-chromedriver\node_modules\appium-jsonwp-proxy\node_modules\babel-runtime\node_modules\core-js\library\modules\$.microtask.js:17:13)
>     at process._tickDomainCallback (node.js:381:11)
>  { [Error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device a8e34a88 is not online
>   (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64))]
>   status: 13,
>   value: { message: 'unknown error: Device a8e34a88 is not online\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)' },
>   httpCode: 200 }
> info: <-- POST /wd/hub/session/ce0c9924-6801-4e8d-88e6-d423d93a29e9/context - - ms - - 
> undefined

#17 楼 @601068603 要从 WebView 中切换出来,在 APP 上操作的都要切换到 NATIVE_APP,而且切换到 NATIVE_APP 后与下一步的动作中间不要加 Thread 等待,会产生不稳定报错(比如拍照上传图片)。就好比在 PC 端测试网页要切换到桌面

#19 楼 @luke 请问,切换到 Weview 后不操作 find element 怎么解决呢?谢谢~

#17 楼 @601068603 问题解决了么?谢谢~

同样的问题,一直没解决

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册