Appium 版本

1.15.0

代码截图

def do_exercise(self,paper_title_str):
    self.chioce_shubject()
    self.chioce_quest_bank_type('每日一练')
    import time
    if self.base.ios_check_element(self.unstart):
        self.base.ios_predicate(self.unstart).click()
        paper_title = self.paper_title.format(paper_title_str)
        if self.base.ios_check_element(paper_title):
            self.base.ios_predicate(paper_title).click()
            self.restart_do_func()
            time.sleep(1)
            contexts = self.base.get_context_list()
            try:
                self.base.choice_context(contexts[-1])

                url = self.driver.current_url
                page = self.base.get_page()
            except Exception as e:
                print(e)

输出 context

2019-10-03 16:23:07,381 -Base- baseView.py[line:174] - INFO: ['NATIVE_APP', 'WEBVIEW_298.3', 'WEBVIEW_298.5', 'WEBVIEW_298.6']

Appium 日志

[35m[RemoteDebugger][39m Remote Debugger version 5.7.0
[debug] [35m[RemoteDebugger][39m useNewSafari --> false
[debug] [35m[RemoteDebugger][39m Checking which communication style to use (non-Safari on platform version '11.2')
[debug] [35m[RemoteDebugger][39m Platform version equal or higher than '12.2': false
[35m[RemoteDebugger][39m Setting communication protocol: using full Web Inspector protocol communication
[debug] [35m[RemoteDebugger][39m Sending connection key request
[debug] [35m[RemoteDebugger][39m Sending '_rpc_reportIdentifier:' message (id: 0)
[debug] [35m[RemoteDebugger][39m Notified that new application 'PID:302' has connected
[debug] [35m[RemoteDebugger][39m Connected to application
[debug] [35m[RemoteDebugger][39m Selecting application
[debug] [35m[RemoteDebugger][39m Current applications available:
[debug] [35m[RemoteDebugger][39m     Application: 'PID:302'
[debug] [35m[RemoteDebugger][39m         id: "PID:302"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m Found app id key 'PID:302' for bundle 'cn.btclass.sierra'
[debug] [35m[RemoteDebugger][39m Trying out the possible app ids: PID:302
[debug] [35m[RemoteDebugger][39m Selecting app PID:302 (try #1 of 20)
[debug] [35m[RemoteDebugger][39m Sending '_rpc_forwardGetListing:' message to app 'PID:302' (id: 1)
[debug] [35m[RemoteDebugger][39m Notified that new application 'PID:298' has connected
[debug] [35m[RemoteDebugger][39m Found app id key 'PID:298' for bundle 'cn.btclass.sierra'
[debug] [35m[RemoteDebugger][39m Found separate bundleId 'com.apple.WebKit.WebContent' acting as proxy for 'cn.btclass.sierra', with app id 'PID:302'
[debug] [35m[RemoteDebugger][39m Using proxied app id 'PID:302'
[debug] [35m[RemoteDebugger][39m We were notified we might have connected to the wrong app. Using id PID:304 instead of PID:298
[debug] [35m[RemoteDebugger][39m Notified that new application 'PID:304' has connected
[debug] [35m[RemoteDebugger][39m Received response from send (id: 1): '["PID:302",{}]'
[debug] [35m[RemoteDebugger][39m Sending to Web Inspector took 37ms
[debug] [35m[RemoteDebugger][39m Error checking application: 'New application has connected'. Retrying connection
[debug] [35m[RemoteDebugger][39m Empty page dictionary received
[debug] [35m[RemoteDebugger][39m Current applications available:
[debug] [35m[RemoteDebugger][39m     Application: 'PID:302'
[debug] [35m[RemoteDebugger][39m         id: "PID:302"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m     Application: 'PID:298'
[debug] [35m[RemoteDebugger][39m         id: "PID:298"
[debug] [35m[RemoteDebugger][39m         isProxy: false
[debug] [35m[RemoteDebugger][39m         name: "BT学院3.0"
[debug] [35m[RemoteDebugger][39m         bundleId: "cn.btclass.sierra"
[debug] [35m[RemoteDebugger][39m         hostId: undefined
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray:
[debug] [35m[RemoteDebugger][39m           - id: 3
[debug] [35m[RemoteDebugger][39m             title: "BT学院"
[debug] [35m[RemoteDebugger][39m             url: "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 5
[debug] [35m[RemoteDebugger][39m             title: "question"
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 6
[debug] [35m[RemoteDebugger][39m             title: ""
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m     Application: 'PID:304'
[debug] [35m[RemoteDebugger][39m         id: "PID:304"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m Page changed: {
[debug] [35m[RemoteDebugger][39m   "3": {
[debug] [35m[RemoteDebugger][39m     "WIRTitleKey": "BT学院",
[debug] [35m[RemoteDebugger][39m     "WIRTypeKey": "WIRTypeWeb",
[debug] [35m[RemoteDebugger][39m     "WIRURLKey": "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059",
[debug] [35m[RemoteDebugger][39m     "WIRPageIdentifierKey": 3
[debug] [35m[RemoteDebugger][39m   },
[debug] [35m[RemoteDebugger][39m   "5": {
[debug] [35m[RemoteDebugger][39m     "WIRTitleKey": "question",
[debug] [35m[RemoteDebugger][39m     "WIRTypeKey": "WIRTypeWeb",
[debug] [35m[RemoteDebugger][39m     "WIRURLKey": "about:blank",
[debug] [35m[RemoteDebugger][39m     "WIRPageIdentifierKey": 5
[debug] [35m[RemoteDebugger][39m   },
[debug] [35m[RemoteDebugger][39m   "6": {
[debug] [35m[RemoteDebugger][39m     "WIRTitleKey": "",
[debug] [35m[RemoteDebugger][39m     "WIRTypeKey": "WIRTypeWeb",
[debug] [35m[RemoteDebugger][39m     "WIRURLKey": "about:blank",
[debug] [35m[RemoteDebugger][39m     "WIRPageIdentifierKey": 6
[debug] [35m[RemoteDebugger][39m   }
[debug] [35m[RemoteDebugger][39m }
[debug] [35m[RemoteDebugger][39m Received page change notice for app 'PID:298' but listening for 'PID:302'. Ignoring.
[debug] [35m[RemoteDebugger][39m Current applications available:
[debug] [35m[RemoteDebugger][39m     Application: 'PID:302'
[debug] [35m[RemoteDebugger][39m         id: "PID:302"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m     Application: 'PID:298'
[debug] [35m[RemoteDebugger][39m         id: "PID:298"
[debug] [35m[RemoteDebugger][39m         isProxy: false
[debug] [35m[RemoteDebugger][39m         name: "BT学院3.0"
[debug] [35m[RemoteDebugger][39m         bundleId: "cn.btclass.sierra"
[debug] [35m[RemoteDebugger][39m         hostId: undefined
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray:
[debug] [35m[RemoteDebugger][39m           - id: 3
[debug] [35m[RemoteDebugger][39m             title: "BT学院"
[debug] [35m[RemoteDebugger][39m             url: "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 5
[debug] [35m[RemoteDebugger][39m             title: "question"
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 6
[debug] [35m[RemoteDebugger][39m             title: ""
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m     Application: 'PID:304'
[debug] [35m[RemoteDebugger][39m         id: "PID:304"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m Found app id key 'PID:298' for bundle 'cn.btclass.sierra'
[debug] [35m[RemoteDebugger][39m Found separate bundleId 'com.apple.WebKit.WebContent' acting as proxy for 'cn.btclass.sierra', with app id 'PID:302'
[debug] [35m[RemoteDebugger][39m Found separate bundleId 'com.apple.WebKit.WebContent' acting as proxy for 'cn.btclass.sierra', with app id 'PID:304'
[debug] [35m[RemoteDebugger][39m Trying out the possible app ids: PID:298, PID:302, PID:304
[debug] [35m[RemoteDebugger][39m Selecting app PID:298 (try #1 of 20)
[debug] [35m[RemoteDebugger][39m Sending '_rpc_forwardGetListing:' message to app 'PID:298' (id: 2)
[debug] [35m[RemoteDebugger][39m Received response from send (id: 2): '["PID:298",{"3":{"WIRTitleKey":"BT学院","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjo...'
[debug] [35m[RemoteDebugger][39m Received page change notice for app 'PID:298' but the listing has not changed. Ignoring.
[debug] [35m[RemoteDebugger][39m Sending to Web Inspector took 9ms
[debug] [35m[RemoteDebugger][39m Received altered app id, updating from 'PID:302' to 'PID:298'
[debug] [35m[RemoteDebugger][39m Current applications available:
[debug] [35m[RemoteDebugger][39m     Application: 'PID:302'
[debug] [35m[RemoteDebugger][39m         id: "PID:302"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m     Application: 'PID:298'
[debug] [35m[RemoteDebugger][39m         id: "PID:298"
[debug] [35m[RemoteDebugger][39m         isProxy: false
[debug] [35m[RemoteDebugger][39m         name: "BT学院3.0"
[debug] [35m[RemoteDebugger][39m         bundleId: "cn.btclass.sierra"
[debug] [35m[RemoteDebugger][39m         hostId: undefined
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray:
[debug] [35m[RemoteDebugger][39m           - id: 3
[debug] [35m[RemoteDebugger][39m             title: "BT学院"
[debug] [35m[RemoteDebugger][39m             url: "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 5
[debug] [35m[RemoteDebugger][39m             title: "question"
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 6
[debug] [35m[RemoteDebugger][39m             title: ""
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m     Application: 'PID:304'
[debug] [35m[RemoteDebugger][39m         id: "PID:304"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m Finally selecting app PID:298: [{"id":3,"title":"BT学院","url":"https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059","isKey":false},{"id":5,"title":"question","url":"about:blank","isKey":false},{"id":6,"title":"","url":"about:blank","isKey":false}]
[debug] [35m[RemoteDebugger][39m Selected app after 577ms
[debug] [35m[W3C (31313dfb)][39m Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_298.3","WEBVIEW_298.5","WEBVIEW_298.6"]
[35m[HTTP][39m [37m<-- GET /wd/hub/session/31313dfb-2e1a-4abd-9fed-000ca6a50f76/contexts [39m[32m200[39m [90m764 ms - 72[39m
[35m[HTTP][39m [90m[39m
[35m[HTTP][39m [37m-->[39m [37mGET[39m [37m/wd/hub/session/31313dfb-2e1a-4abd-9fed-000ca6a50f76/contexts[39m
[35m[HTTP][39m [90m{}[39m
[debug] [35m[W3C (31313dfb)][39m Calling AppiumDriver.getContexts() with args: ["31313dfb-2e1a-4abd-9fed-000ca6a50f76"]
[debug] [35m[XCUITest][39m Executing command 'getContexts'
[debug] [35m[iOS][39m Getting list of available contexts
[debug] [35m[iOS][39m Retrieving contexts and views
[debug] [35m[XCUITest][39m Selecting by url: false 
[debug] [35m[RemoteDebugger][39m Selecting application
[debug] [35m[RemoteDebugger][39m Current applications available:
[debug] [35m[RemoteDebugger][39m     Application: 'PID:302'
[debug] [35m[RemoteDebugger][39m         id: "PID:302"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m     Application: 'PID:298'
[debug] [35m[RemoteDebugger][39m         id: "PID:298"
[debug] [35m[RemoteDebugger][39m         isProxy: false
[debug] [35m[RemoteDebugger][39m         name: "BT学院3.0"
[debug] [35m[RemoteDebugger][39m         bundleId: "cn.btclass.sierra"
[debug] [35m[RemoteDebugger][39m         hostId: undefined
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray:
[debug] [35m[RemoteDebugger][39m           - id: 3
[debug] [35m[RemoteDebugger][39m             title: "BT学院"
[debug] [35m[RemoteDebugger][39m             url: "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 5
[debug] [35m[RemoteDebugger][39m             title: "question"
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 6
[debug] [35m[RemoteDebugger][39m             title: ""
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m     Application: 'PID:304'
[debug] [35m[RemoteDebugger][39m         id: "PID:304"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m Found app id key 'PID:298' for bundle 'cn.btclass.sierra'
[debug] [35m[RemoteDebugger][39m Found separate bundleId 'com.apple.WebKit.WebContent' acting as proxy for 'cn.btclass.sierra', with app id 'PID:302'
[debug] [35m[RemoteDebugger][39m Found separate bundleId 'com.apple.WebKit.WebContent' acting as proxy for 'cn.btclass.sierra', with app id 'PID:304'
[debug] [35m[RemoteDebugger][39m Trying out the possible app ids: PID:298, PID:302, PID:304
[debug] [35m[RemoteDebugger][39m Selecting app PID:298 (try #1 of 20)
[debug] [35m[RemoteDebugger][39m Sending '_rpc_forwardGetListing:' message to app 'PID:298' (id: 3)
[debug] [35m[RemoteDebugger][39m Received response from send (id: 3): '["PID:298",{"3":{"WIRTitleKey":"BT学院","WIRTypeKey":"WIRTypeWeb","WIRURLKey":"https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjo...'
[debug] [35m[RemoteDebugger][39m Received page change notice for app 'PID:298' but the listing has not changed. Ignoring.
[debug] [35m[RemoteDebugger][39m Sending to Web Inspector took 9ms
[debug] [35m[RemoteDebugger][39m Current applications available:
[debug] [35m[RemoteDebugger][39m     Application: 'PID:302'
[debug] [35m[RemoteDebugger][39m         id: "PID:302"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m     Application: 'PID:298'
[debug] [35m[RemoteDebugger][39m         id: "PID:298"
[debug] [35m[RemoteDebugger][39m         isProxy: false
[debug] [35m[RemoteDebugger][39m         name: "BT学院3.0"
[debug] [35m[RemoteDebugger][39m         bundleId: "cn.btclass.sierra"
[debug] [35m[RemoteDebugger][39m         hostId: undefined
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray:
[debug] [35m[RemoteDebugger][39m           - id: 3
[debug] [35m[RemoteDebugger][39m             title: "BT学院"
[debug] [35m[RemoteDebugger][39m             url: "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 5
[debug] [35m[RemoteDebugger][39m             title: "question"
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 6
[debug] [35m[RemoteDebugger][39m             title: ""
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m     Application: 'PID:304'
[debug] [35m[RemoteDebugger][39m         id: "PID:304"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m Finally selecting app PID:298: [{"id":3,"title":"BT学院","url":"https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059","isKey":false},{"id":5,"title":"question","url":"about:blank","isKey":false},{"id":6,"title":"","url":"about:blank","isKey":false}]
[debug] [35m[RemoteDebugger][39m Selected app after 31ms
[debug] [35m[W3C (31313dfb)][39m Responding to client with driver.getContexts() result: ["NATIVE_APP","WEBVIEW_298.3","WEBVIEW_298.5","WEBVIEW_298.6"]
[35m[HTTP][39m [37m<-- GET /wd/hub/session/31313dfb-2e1a-4abd-9fed-000ca6a50f76/contexts [39m[32m200[39m [90m38 ms - 72[39m
[35m[HTTP][39m [90m[39m
[35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session/31313dfb-2e1a-4abd-9fed-000ca6a50f76/context[39m
[35m[HTTP][39m [90m{"name":"WEBVIEW_298.6","sessionId":"31313dfb-2e1a-4abd-9fed-000ca6a50f76"}[39m
[debug] [35m[W3C (31313dfb)][39m Calling AppiumDriver.setContext() with args: ["WEBVIEW_298.6","31313dfb-2e1a-4abd-9fed-000ca6a50f76"]
[debug] [35m[XCUITest][39m Executing command 'setContext'
[debug] [35m[XCUITest][39m Attempting to set context to 'WEBVIEW_298.6'
[debug] [35m[RemoteDebugger][39m Selecting page '6' on app 'PID:298' and forwarding socket setup
[debug] [35m[RemoteDebugger][39m Sending '_rpc_forwardSocketSetup:' message to app 'PID:298', page '6' (id: 4)
[debug] [35m[RemoteDebugger][39m Sending to Web Inspector took 7ms
[debug] [35m[RemoteDebugger][39m Sender key set
[debug] [35m[RemoteDebugger][39m Sending '_rpc_forwardSocketData:' message to app 'PID:298', page '6' (id: 5)
[35m[RemoteDebugger][39m Setting communication protocol: using Target-based communication
[debug] [35m[RemoteDebugger][39m Target created for app 'PID:298' and page '6': {"targetId":"page-1"}
[debug] [35m[RemoteDebugger][39m Sending '_rpc_forwardSocketData:' message to app 'PID:298', page '6', target 'page-1' (id: 6)
[debug] [35m[RemoteDebugger][39m Current applications available:
[debug] [35m[RemoteDebugger][39m     Application: 'PID:302'
[debug] [35m[RemoteDebugger][39m         id: "PID:302"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m     Application: 'PID:298'
[debug] [35m[RemoteDebugger][39m         id: "PID:298"
[debug] [35m[RemoteDebugger][39m         isProxy: false
[debug] [35m[RemoteDebugger][39m         name: "BT学院3.0"
[debug] [35m[RemoteDebugger][39m         bundleId: "cn.btclass.sierra"
[debug] [35m[RemoteDebugger][39m         hostId: undefined
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray:
[debug] [35m[RemoteDebugger][39m           - id: 3
[debug] [35m[RemoteDebugger][39m             title: "BT学院"
[debug] [35m[RemoteDebugger][39m             url: "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 5
[debug] [35m[RemoteDebugger][39m             title: "question"
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: false
[debug] [35m[RemoteDebugger][39m           - id: 6
[debug] [35m[RemoteDebugger][39m             title: ""
[debug] [35m[RemoteDebugger][39m             url: "about:blank"
[debug] [35m[RemoteDebugger][39m             isKey: true
[debug] [35m[RemoteDebugger][39m     Application: 'PID:304'
[debug] [35m[RemoteDebugger][39m         id: "PID:304"
[debug] [35m[RemoteDebugger][39m         isProxy: true
[debug] [35m[RemoteDebugger][39m         name: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         bundleId: "com.apple.WebKit.WebContent"
[debug] [35m[RemoteDebugger][39m         hostId: "PID:298"
[debug] [35m[RemoteDebugger][39m         isActive: 2
[debug] [35m[RemoteDebugger][39m         isAutomationEnabled: false
[debug] [35m[RemoteDebugger][39m         pageArray: 'Waiting for data'
[debug] [35m[RemoteDebugger][39m Page changed: {
[debug] [35m[RemoteDebugger][39m   "3": {
[debug] [35m[RemoteDebugger][39m     "WIRTitleKey": "BT学院",
[debug] [35m[RemoteDebugger][39m     "WIRTypeKey": "WIRTypeWeb",
[debug] [35m[RemoteDebugger][39m     "WIRURLKey": "https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059",
[debug] [35m[RemoteDebugger][39m     "WIRPageIdentifierKey": 3
[debug] [35m[RemoteDebugger][39m   },
[debug] [35m[RemoteDebugger][39m   "5": {
[debug] [35m[RemoteDebugger][39m     "WIRTitleKey": "question",
[debug] [35m[RemoteDebugger][39m     "WIRTypeKey": "WIRTypeWeb",
[debug] [35m[RemoteDebugger][39m     "WIRURLKey": "about:blank",
[debug] [35m[RemoteDebugger][39m     "WIRPageIdentifierKey": 5
[debug] [35m[RemoteDebugger][39m   },
[debug] [35m[RemoteDebugger][39m   "6": {
[debug] [35m[RemoteDebugger][39m     "WIRTitleKey": "",
[debug] [35m[RemoteDebugger][39m     "WIRTypeKey": "WIRTypeWeb",
[debug] [35m[RemoteDebugger][39m     "WIRURLKey": "about:blank",
[debug] [35m[RemoteDebugger][39m     "WIRPageIdentifierKey": 6,
[debug] [35m[RemoteDebugger][39m     "WIRConnectionIdentifierKey": "498f2596-e97b-433e-a853-35e2642214f1"
[debug] [35m[RemoteDebugger][39m   }
[debug] [35m[RemoteDebugger][39m }
[debug] [35m[iOS][39m Remote debugger notified us of a new page listing: {"appIdKey":"298","pageArray":[{"id":3,"title":"BT学院","url":"https://whale.btclass.net/page/home/0?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEwMDAwNTksImRlYWRsaW5lIjoxNTcwMDk4MTQyLCJyYW5kb20iOiJjMm9wb2RjMWRnOCIsImlhdCI6MTU3MDA5MDk0Mn0.nRB3U9NHZ-jYr6u3R9QQz5hEdFR330zdqRX3vyqEgqs&userId=1000059","isKey":false},{"id":5,"title":"question","url":"about:blank","isKey":false},{"id":6,"title":"","url":"about:blank","isKey":true}]}
[debug] [35m[iOS][39m We do not appear to have window set yet, ignoring
[debug] [35m[RemoteDebugger][39m Received page change notice for app 'PID:298' but the listing has not changed. Ignoring.


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