openatx / facebook-wda

Facebook WebDriverAgent Python Client Library (not official)
MIT License
1.72k stars 266 forks source link

iOS 12 unrecognized selector #57

Closed Umiiii closed 5 years ago

Umiiii commented 5 years ago
import wda
c = wda.Client()
c.screenshot()

出现:

WebDriverAgentRunner-Runner[6458:1441982] +[XCAXClient_iOS sharedClient]: unrecognized selector sent to class 0x102d43e50
ariesdevil commented 5 years ago

Same issue for me.

~/.local/share/virtualenvs/ipadpdf-uy4vmIRh/lib/python3.7/site-packages/wda/__init__.py in session(self, bundle_id, arguments, environment)
    301             'desiredCapabilities': capabilities
    302         })
--> 303         res = self.http.post('session', data)
    304         httpclient = self.http.new_client('session/'+res.sessionId)
    305         return Session(httpclient, res.sessionId)

~/.local/share/virtualenvs/ipadpdf-uy4vmIRh/lib/python3.7/site-packages/wda/__init__.py in fetch(self, method, url, data)
    106
    107     def fetch(self, method, url, data=None):
--> 108         return self._fetch_no_alert(method, url, data)
    109         # return httpdo(urljoin(self.address, url), method, data)
    110

~/.local/share/virtualenvs/ipadpdf-uy4vmIRh/lib/python3.7/site-packages/wda/__init__.py in _fetch_no_alert(self, method, url, data, depth)
    112         target_url = urljoin(self.address, url)
    113         try:
--> 114             return httpdo(target_url, method, data)
    115         except WDAError as err:
    116             if depth >= 10:

~/.local/share/virtualenvs/ipadpdf-uy4vmIRh/lib/python3.7/site-packages/wda/__init__.py in httpdo(url, method, data)
     88     r = convert(retjson)
     89     if r.status != 0:
---> 90         raise WDAError(r.status, r.value)
     91     return r
     92

WDAError: WDAError(status=13, value=+[XCAXClient_iOS sharedClient]: unrecognized selector sent to class 0x103170130

(
    0   CoreFoundation                      0x00000001f1b9b530 <redacted> + 252
    1   libobjc.A.dylib                     0x00000001f0d769f8 objc_exception_throw + 56
    2   CoreFoundation                      0x00000001f1abd2c4 <redacted> + 0
    3   CoreFoundation                      0x00000001f1ba0d60 <redacted> + 1408
    4   CoreFoundation                      0x00000001f1ba29fc _CF_forwarding_prep_0 + 92
    5   WebDriverAgentLib                   0x0000000106c485d0 __37+[FBApplication fb_activeApplication]_block_invoke + 52
    6   WebDriverAgentLib                   0x0000000106c21700 -[FBRunLoopSpinner spinUntilTrue:error:] + 152
    7   WebDriverAgentLib                   0x0000000106c21640 -[FBRunLoopSpinner spinUntilTrue:] + 84
    8   WebDriverAgentLib                   0x0000000106c48330 +[FBApplication fb_activeApplication] + 128
    9   WebDriverAgentLib                   0x0000000106c33d74 -[FBSession application] + 332
    10  WebDriverAgentLib                   0x0000000106c3ab44 +[FBSessionCommands currentCapabilities] + 124
    11  WebDriverAgentLib                   0x0000000106c3aa00 +[FBSessionCommands sessionInformation] + 288
    12  WebDriverAgentLib                   0x0000000106c3a038 +[FBSessionCommands handleCreateSession:] + 1404
    13  WebDriverAgentLib                   0x0000000106c20120 -[FBRoute_TargetAction mountRequest:intoResponse:] + 220
    14  WebDriverAgentLib                   0x0000000106c165c0 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 504
    15  RoutingHTTPServer                   0x0000000106cd63cc -[RoutingHTTPServer handleRoute:withRequest:response:] + 144
    16  RoutingHTTPServer                   0x0000000106cd6b80 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 44
    17  libdispatch.dylib                   0x00000001f15dc7d4 <redacted> + 16
    18  libdispatch.dylib                   0x00000001f158ace8 <redacted> + 92
    19  libdispatch.dylib                   0x00000001f15dc7d4 <redacted> + 16
    20  libdispatch.dylib                   0x00000001f158a004 <redacted> + 1068
    21  CoreFoundation                      0x00000001f1b2cec0 <redacted> + 12
    22  CoreFoundation                      0x00000001f1b27df8 <redacted> + 1924
    23  CoreFoundation                      0x00000001f1b27354 CFRunLoopRunSpecific + 436
    24  Foundation                          0x00000001f24f4fcc <redacted> + 300
    25  WebDriverAgentLib                   0x0000000106c155cc -[FBWebServer startServing] + 416
    26  WebDriverAgentRunner                0x0000000106bffbe8 -[UITestingUITests testRunner] + 124
    27  CoreFoundation                      0x00000001f1ba2ba0 <redacted> + 144
    28  CoreFoundation                      0x00000001f1a84c90 <redacted> + 292
    29  XCTest                              0x000000010306600c __24-[XCTestCase invokeTest]_block_invoke_2.200 + 68
    30  XCTest                              0x00000001030cdef8 -[XCTMemoryChecker _assertInvalidObjectsDeallocatedAfterScope:] + 68
    31  XCTest                              0x000000010306e604 -[XCTestCase assertInvalidObjectsDeallocatedAfterScope:] + 112
    32  XCTest                              0x0000000103065f98 __24-[XCTestCase invokeTest]_block_invoke.194 + 196
    33  XCTest                              0x00000001030baed4 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 64
    34  XCTest                              0x00000001030badec -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 108
    35  XCTest                              0x0000000103065bc8 __24-[XCTestCase invokeTest]_block_invoke + 808
    36  XCTest                              0x00000001030c0e8c -[XCUITestContext performInScope:] + 144
    37  XCTest                              0x00000001030657cc -[XCTestCase testContextPerformInScope:] + 120
    38  XCTest                              0x000000010306588c -[XCTestCase invokeTest] + 140
    39  XCTest                              0x000000010306735c __26-[XCTestCase performTest:]_block_invoke_2 + 44
    40  XCTest                              0x00000001030baed4 -[XCTestCase(Failures) performFailableBlock:testCaseRun:shouldInterruptTest:] + 64
    41  XCTest                              0x00000001030badec -[XCTestCase(Failures) _performTurningExceptionsIntoFailuresInterruptAfterHandling:block:] + 108
    42  XCTest                              0x0000000103067274 __26-[XCTestCase performTest:]_block_invoke.324 + 96
    43  XCTest                              0x00000001030cb440 +[XCTContext runInContextForTestCase:block:] + 216
    44  XCTest                              0x0000000103066a2c -[XCTestCase performTest:] + 644
    45  XCTest                              0x00000001030a80e8 -[XCTest runTest] + 60
    46  XCTest                              0x000000010306181c __27-[XCTestSuite performTest:]_block_invoke + 280
    47  XCTest                              0x000000010306113c -[XCTestSuite _performProtectedSectionForTest:testSection:] + 68
    48  XCTest                              0x00000001030613d8 -[XCTestSuite performTest:] + 276
    49  XCTest                              0x00000001030a80e8 -[XCTest runTest] + 60
    50  XCTest                              0x000000010306181c __27-[XCTestSuite performTest:]_block_invoke + 280
    51  XCTest                              0x000000010306113c -[XCTestSuite _performProtectedSectionForTest:testSection:] + 68
    52  XCTest                              0x00000001030613d8 -[XCTestSuite performTest:] + 276
    53  XCTest                              0x00000001030a80e8 -[XCTest runTest] + 60
    54  XCTest                              0x000000010306181c __27-[XCTestSuite performTest:]_block_invoke + 280
    55  XCTest                              0x000000010306113c -[XCTestSuite _performProtectedSectionForTest:testSection:] + 68
    56  XCTest                              0x00000001030613d8 -[XCTestSuite performTest:] + 276
    57  XCTest                              0x00000001030a80e8 -[XCTest runTest] + 60
    58  XCTest                              0x00000001030d86a8 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke + 176
    59  XCTest                              0x00000001030d8778 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke.80 + 60
    60  XCTest                              0x00000001030786d0 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 516
    61  XCTest                              0x00000001030d8464 -[XCTTestRunSession runTestsAndReturnError:] + 596
    62  XCTest                              0x0000000103046704 -[XCTestDriver runTestsAndReturnError:] + 436
    63  XCTest                              0x00000001030c78c0 _XCTestMain + 2248
    64  WebDriverAgentRunner-Runner         0x0000000102d0bb60 -[_XCTRunnerAppDelegate applicationWillResignActive:] + 0
    65  WebDriverAgentRunner-Runner         0x0000000102d0ba68 _XCTRunnerRunTests + 0
    66  CoreFoundation                      0x00000001f1b2d10c <redacted> + 20
    67  CoreFoundation                      0x00000001f1b2ca10 <redacted> + 272
    68  CoreFoundation                      0x00000001f1b27a74 <redacted> + 1024
    69  CoreFoundation                      0x00000001f1b27354 CFRunLoopRunSpecific + 436
    70  GraphicsServices                    0x00000001f3d2779c GSEventRunModal + 104
    71  UIKitCore                           0x000000021daf0b68 UIApplicationMain + 212
    72  WebDriverAgentRunner-Runner         0x0000000102d0bd3c main + 192
    73  libdyld.dylib                       0x00000001f15ed8e0 <redacted> + 4
))
codeskyblue commented 5 years ago

It is better to raise issue on https://github.com/facebook/WebDriverAgent, There is nothing I can do.

warm200 commented 5 years ago

appinum有个 forked repo https://github.com/appium/WebDriverAgent 临时可以解决这个问题,亲测好用. 只要按照wda的方法从新build一遍就可以

GreenAndDay commented 5 years ago

appinum有个 forked repo https://github.com/appium/WebDriverAgent 临时可以解决这个问题,亲测好用. 只要按照wda的方法从新build一遍就可以

我重新安装了wda,还是报一样的错误,help~

michenging commented 5 years ago

上面的意思是下载这个wda https://github.com/appium/WebDriverAgent 然后重新对刚下的wda进行./Scripts/bootstrap.sh

junjie58msp commented 5 years ago

移步到:https://github.com/appium/WebDriverAgent 这里已经不怎么活跃了...

codeskyblue commented 5 years ago

@junjie58msp appium的issue不能提到WebDriverAgent下