• uiautomator2, 拉起 ChromeDriver 报错,是否是 Chrome 兼容问题

    [1645163734.564][SEVERE]: bind() returned an error: ͨ��ÿ���׽��ֵ�ַ(Э��/�����ַ/�˿�)ֻ����ʹ��һ�Ρ� (0x2740)
    Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 9515
    Only local connections are allowed.
    Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
    IPv6 port not available. Exiting...
    [1645163734.596][SEVERE]: bind() returned an error: ͨ��ÿ���׽��ֵ�ַ(Э��/�����ַ/�˿�)ֻ����ʹ��һ�Ρ� (0x2740)
    Traceback (most recent call last):
    File "D:\Program Files\Python38\lib\site-packages\atx\ext\chromedriver.py", line 70, in driver
    dr = webdriver.Remote('http://localhost:%d' % self.port, capabilities,options)
    File "D:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init
    _
    self.start_session(capabilities, browser_profile)
    File "D:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 355, in start_session
    capabilities.update({'firefox_profile': browser_profile.encoded})
    AttributeError: 'Options' object has no attribute 'encoded'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "E:/APP/SmartMonkeyTest/uitest/android_uiparser_uiautomator.py", line 194, in
    wd = ChromeDriver(d).driver()
    File "D:\Program Files\Python38\lib\site-packages\atx\ext\chromedriver.py", line 77, in driver
    dr = webdriver.Remote('http://localhost:%d' % self.port, capabilities)
    File "D:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init
    _
    self.start_session(capabilities, browser_profile)
    File "D:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 359, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
    File "D:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
    File "D:\Program Files\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

  • 把报错的信息贴出来把

  • 配置如下

    desiredCapabilities.setCapability(IOSMobileCapabilityType.WEB_DRIVER_AGENT_URL, "http://127.0.0.1:8100");
    desiredCapabilities.setCapability("noReset", true);
    desiredCapabilities.setCapability(IOSMobileCapabilityType.USE_PREBUILT_WDA, false);
    desiredCapabilities.setCapability("useXctestrunFile", false);
    desiredCapabilities.setCapability("skipLogCapture", true);
    desiredCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 80000);
    可以调通了,而且以获得 iOSDriver,成功了
    io.appium.java_client.ios.IOSDriver, Capabilities: {browserName=, bundleId=XXX, databaseEnabled=false, deviceName=XXX, javascriptEnabled=true, locationContextEnabled=false, networkConnectionEnabled=false, newCommandTimeout=80000, noReset=true, platform=MAC, platformName=iOS, platformVersion=14.0, skipLogCapture=true, takesScreenshot=true, udid=XXXX, usePrebuiltWDA=false, useXctestrunFile=false, webDriverAgentUrl=http://127.0.0.1:8100, webStorageEnabled=false}

  • 我也是遇到相同的难题了, 怎么和 iOS 通信,是否还需要装新的软件

  • Windows appium 桌面的版本, webdriver 似乎获取不到,appium 启动会报错, [info] [35m[Appium][39m Welcome to Appium v1.17.1
    [info] [35m[Appium][39m Non-default server args:
    [info] [35m[Appium][39m allowInsecure: {
    [info] [35m[Appium][39m }
    [info] [35m[Appium][39m denyInsecure: {
    [info] [35m[Appium][39m }
    [info] [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723[info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m
    [
    [debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1614848011695 (16:53:31 GMT+0800 (中国标准时间))
    [info] [35m[Appium][39m Appium v1.17.1 creating new XCUITestDriver (v3.22.0) session
    [debug] [35m[BaseDriver][39m Creating session with MJSONWP desired capabilities: {
    [debug] [35m[BaseDriver][39m "app": "com.xxxxxx",
    [debug] [35m[BaseDriver][39m "automationName": "XCUITest",
    [debug] [35m[BaseDriver][39m "deviceName": "rock",
    [debug] [35m[BaseDriver][39m "platformName": "iOS",
    [debug] [35m[BaseDriver][39m "platformVersion": "14.0",
    [debug] [35m[BaseDriver][39m "udid": "xxxxxxxx",
    [debug] [35m[BaseDriver][39m "useNewWDA": true,
    [debug] [35m[BaseDriver][39m "newCommandTimeout": 0,
    [debug] [35m[BaseDriver][39m "connectHardwareKeyboard": true
    [debug] [35m[BaseDriver][39m }
    [info] [35m[BaseDriver][39m Session created with session id: 18c8eb20-1a3a-4adc-aeba-935bc0b04e00
    [debug] [35m[ios-device][39m Error: The usbmuxd socket at '/var/run/usbmuxd' does not exist or is not accessible、