之前看了https://testerhome.com/topics/69622 个问题暂时卡主了的文档后,自己在本地搭建尝试,但出现
问题 1:
网页打开 inspector 报错
{
"value" : "Invalid parameter not satisfying: path\n\n(\n\t0 CoreFoundation 0x000000010801334b exceptionPreprocess + 171\n\t1 libobjc.A.dylib 0x0000000107a7421e objc_exception_throw + 48\n\t2 CoreFoundation 0x0000000108017442 +[NSException raise:format:arguments:] + 98\n\t3 Foundation 0x000000010760aedd -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195\n\t4 WebDriverAgentLib 0x000000011425718b -[FBResponseFilePayload initWithFilePath:] + 283\n\t5 WebDriverAgentLib 0x00000001142526b7 FBResponseFileWithPath + 87\n\t6 WebDriverAgentLib 0x000000011426477c __29+[FBInspectorCommands routes]_block_invoke + 108\n\t7 WebDriverAgentLib 0x000000011425297c -[FBRoute_Sync mountRequest:intoResponse:] + 140\n\t8 WebDriverAgentLib 0x0000000114249de4 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 548\n\t9 RoutingHTTPServer 0x0000000114301c18 -[RoutingHTTPServer handleRoute:withRequest:response:] + 136\n\t10 RoutingHTTPServer 0x00000001143024fa __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 47\n\t11 libdispatch.dylib 0x000000010ad3612e _dispatch_client_callout + 8\n\t12 libdispatch.dylib 0x000000010ad1e7a5 _dispatch_barrier_sync_f_slow_invoke + 315\n\t13 libdispatch.dylib 0x000000010ad3612e _dispatch_client_callout + 8\n\t14 libdispatch.dylib 0x000000010ad1d52d _dispatch_main_queue_callback_4CF + 1054\n\t15 CoreFoundation 0x0000000107fd74f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9\n\t16 CoreFoundation 0x0000000107f9cf8d CFRunLoopRun + 2205\n\t17 CoreFoundation 0x0000000107f9c494 CFRunLoopRunSpecific + 420\n\t18 Foundation 0x0000000107557080 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 274\n\t19 Foundation 0x0000000107556f5b -[NSRunLoop(NSRunLoop) run] + 76\n\t20 WebDriverAgentLib 0x0000000114248cd6 -[FBWebServer startServing] + 262\n\t21 WebDriverAgentRunner 0x0000000114240d34 -[UITestingUITests testRunner] + 100\n\t22 CoreFoundation 0x0000000107f9a05c __invoking_ + 140\n\t23 CoreFoundation 0x0000000107f99ee1 -[NSInvocation invoke] + 289\n\t24 XCTest 0x000000010744af77 24-[XCTestCase invokeTest]_block_invoke_2 + 481\n\t25 XCTest 0x00000001074837df -[XCTestContext performInScope:] + 190\n\t26 XCTest 0x000000010744ad83 -[XCTestCase invokeTest] + 255\n\t27 XCTest 0x000000010744b59c -[XCTestCase performTest:] + 457\n\t28 XCTest 0x0000000107448664 -[XCTestSuite performTest:] + 491\n\t29 XCTest 0x0000000107448664 -[XCTestSuite performTest:] + 491\n\t30 XCTest 0x0000000107448664 -[XCTestSuite performTest:] + 491\n\t31 XCTest 0x0000000107434618 __25-[XCTestDriver _runSuite]_block_invoke + 51\n\t32 XCTest 0x0000000107455d2b -[XCTestObservationCenter _observeTestExecutionForBlock:] + 602\n\t33 XCTest 0x00000001074344b5 -[XCTestDriver _runSuite] + 436\n\t34 XCTest 0x0000000107435302 -[XCTestDriver _checkForTestManager] + 287\n\t35 XCTest 0x0000000107484d67 _XCTestMain + 628\n\t36 CoreFoundation 0x0000000107fb825c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12\n\t37 CoreFoundation 0x0000000107f9d304 CFRunLoopDoBlocks + 356\n\t38 CoreFoundation 0x0000000107f9ca75 __CFRunLoopRun + 901\n\t39 CoreFoundation 0x0000000107f9c494 CFRunLoopRunSpecific + 420\n\t40 GraphicsServices 0x000000010a474a6f GSEventRunModal + 161\n\t41 UIKit 0x0000000108436f34 UIApplicationMain + 159\n\t42 XCTRunner 0x00000001073b581c XCTRunner + 6172\n\t43 libdyld.dylib 0x000000010ad7f68d start + 1\n\t44 ??? 0x0000000000000005 0x0 + 5\n)",
"sessionId" : "F089ED67-986B-47F9-8AC4-6D4F9BB566E6",
"status" : 13
}
问题 2:
运行 appium 测试例子,报错
python ios_simple.py
test_scroll (
main_.SimpleIOSTests) ... ERROR
test_ui_computation (
main_.SimpleIOSTests) ... ERROR

======================================================================

ERROR: test_scroll (main.SimpleIOSTests)

Traceback (most recent call last):
File "ios_simple.py", line 24, in setUp
'deviceName':'iPhone Simulator'
File "build/bdist.macosx-10.6-intel/egg/appium/webdriver/webdriver.py", line 36, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 92, in init
self.start_session(desired_capabilities, browser_profile)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 163, in check_response
raise exception_class(value)
WebDriverException: Message: Unhandled endpoint: /wd/hub//session -- http://localhost:8100/ with parameters {
wildcards = (
"wd/hub//session"
);
}

======================================================================

ERROR: test_ui_computation (main.SimpleIOSTests)

Traceback (most recent call last):
File "ios_simple.py", line 24, in setUp
'deviceName':'iPhone Simulator'
File "build/bdist.macosx-10.6-intel/egg/appium/webdriver/webdriver.py", line 36, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 92, in init
self.start_session(desired_capabilities, browser_profile)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium-3.0.2-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 163, in check_response
raise exception_class(value)
WebDriverException: Message: Unhandled endpoint: /wd/hub//session -- http://localhost:8100/ with parameters {
wildcards = (
"wd/hub//session"
);
}

刚刚接触 appium,搭建环境出现问题,链接模拟器和真机尝试跑脚本也不行,求帮助~谢谢


↙↙↙阅读原文可查看相关链接,并与作者交流