appium使用,从桌面打开appium ,python调用时,没有问题,但是命令行打开appium 调用,就会报错

步骤:
1、执行 java -jar selenium-server-standalone-3.141.59.jar -role hub 成功
image
2、修改node1.json
{
“capabilities”:
[
{
“browserName”: “”,
“version”:“6.0”,
“maxInstances”: 1,
“platform”:“ANDROID”
}
],
“configuration”:
{
“cleanUpCycle”:2000,
“timeout”:30000,
“proxy”: “org.openqa.grid.selenium.proxy.DefaultRemoteProxy”,
“url”:“http://localhost:4723/wd/hub”,
“host”: “localhost”,
“port”: 4723,
“maxSession”: 1,
“register”: true,
“registerCycle”: 5000,
“hubPort”: 4444,
“hubHost”: “192.168.247.1”,
“hubProtocol”: “http”
}
}
3、执行 appium --nodeconfig node1.json 成功
image

4、执行代码:


from time import sleep

from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy

class TestXueqiu:

def setup(self):
    print("setup")
    caps = {}
    caps['deviceName'] = 'hogwards'
    caps['platformName'] = 'Android'
    caps['platformVersion'] = '6.0'
    caps['appPackage'] = "com.xueqiu.android"
    caps['appActivity'] = ".view.WelcomeActivityAlias"
    caps['noReset'] = 'true'

    # 之前常规的写法
    # self.driver = webdriver.Remote('http://localhost:4723/wd/hub', caps)
    # 添加hub功能后的写法,  cmd 执行命令  java -jar .\selenium-server-standalone-3.141.59.jar  获得的 Clients should connect to http://192.168.247.1:4444/wd/hub
    self.driver = webdriver.Remote('http://192.168.247.1:4444/wd/hub', caps)
    self.driver.implicitly_wait(10)

def teardown(self):
    print("teardown")
    self.driver.quit()


def test_search(self):
    print("到底是什么问题呢")
    self.driver.find_element(MobileBy.ID, 'com.xueqiu.android:id/tv_search').click()
    self.driver.find_element(MobileBy.ID, 'com.xueqiu.android:id/search_input_text').send_keys('alibaba')

5、可以调用起app, app启动后,就马上报错

nodejs 使用的是什么版本?

image

看一下seleNium grid的日志和appium的日志 ,看 一下里面报的什么错?

image

把完整的appium日志复制到txt文件里作为附件发出来吧 看一下整个appium的运行是什么状态
另外重启一下appium再试试呢?

log.txt (24.0 KB)

卸载 这两个包,让appium重新安装,试一下
io.appium.uiautomator2.server 和 io.appium.uiautomator2.server.test

额,这两个包在哪卸载呀

adb shell pm uninstall io.appium.uiautomator2.server

adb shell pm uninstall io.appium.uiautomator2.server.test

老师,还是报错一样的错