-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating session is too slow #623
Comments
Suggestion : if Webdriveragent works without session and appium-xcuitest-driver manages sessions itself based on connections, I think it can save time in session creation as well as connection issues. |
As https://github.com/appium/WebDriverAgent#features , the request body should follow the W3C protocol since this one is also ordinally expected to follow WebDriver Protocol. https://github.com/appium/appium-xcuitest-driver/blob/master/lib/driver.js#L1104-L1134 is what the XCUITest driver sends. The device messages, I quickly calculated it with a simulator and a real device, with
So, I don't know the exact reason, but I guess your case is something the device condition specific, or there is some condition in XCTest internal. (at least not with/without session stuff, but something before getting If the device under test many installed apps, I guess it would be help to reduce the installed ones. Then, potentially the application finding by XCTest would become faster |
I also tried removing WDA from the device and re-install via the xcodebuild command on both the simulator and the real device, and re-create a simulator instance case as well, but I was not able to see the slowness. Could you share what the first try means?
|
May be depends on ios version, I am facing similar issue on os 14.7.1 for device iphone 12 pro and not on ios 16.x versions |
@KazuCocoa do you think pull accessibility hierarchy is taking time based on size of elements in screen? is their anyway to know wda activated in device so determine the session without getting snapshot of accessibility xxx |
I have no exact answer. Only Apple may know of. |
The getting snapshot is used for getting elements etc via XCTest, so maybe it can be skipped only when managing a device via xcrun etc |
Could you use a translation app and attach English? |
Hello, I found that my remote control device takes a long time to send remote control device instructions through the w3c protocol, Found in a burial site commissioning WDA source inside XCSynthesizedEventRecord * eventRecord = [synthesizer synthesizeWithError: error]; This method takes more than 1 second, want to ask this question is also caused by the slow creation of the session? |
You might be able to read the device log as well. The method issues iOS's API, How it works usually depends on iOS internal |
Thank you for your reply. Then I would like to ask when you develop this function, such as automatic test games, where a device controls several devices at the same time. In this case, how long does it take for sliding operation to synchronize the screen of the master and the controlled device? The testers on my side would rather play the game on a mobile phone than use tools to achieve the function of multiple devices at the same time |
I don't have much experience for mobile games. the XCTest usually depends on UI thread usage, so for example if a view use UI thread heavily, usually the action could be slower. |
My following video is the situation of remote control of the main control device, sliding the controlled device feels that the main control device screen response is a little slow Uploading IMG_0011.MOV… |
IMG_0011.MOV |
The following video is the situation of the controlled device remotely controlling the main control device. Sliding the controlled device feels that the screen response of the main control device takes a long time. You also need such a long response when developing and debugging. In addition, I found the time-consuming place of wda source code by burying debugging in XCSynthesizedEventRecord * eventRecord = [synthesizer SynthesizeWithError: error] here, want to ask what optimization? |
Hello everyone,
I am starting the webdriveragent with xcodebuild like that:
xcodebuild -allowProvisioningUpdates -project /projects/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination platform="iOS,id=0000000-0010000000E" test
It gives server url normally. Logs:
Test Case '-[UITestingUITests testRunner]' started.
t = 0.00s Start Test at 2022-10-18 16:37:27.075
t = 0.00s Set Up
2022-10-18 16:37:27.077387+0300 WebDriverAgentRunner-Runner[88623:5742668] Built at Sep 13 2022 13:18:10
2022-10-18 16:37:27.089916+0300 WebDriverAgentRunner-Runner[88623:5742668] ServerURLHere->http://169.254.21.XXX:8100<-ServerURLHere
2022-10-18 16:37:27.090508+0300 WebDriverAgentRunner-Runner[88623:5742851] Using singleton test manager
2022-10-18 16:38:37.773636+0300 WebDriverAgentRunner-Runner[88623:5742668] Getting the most recent active application (out of 1 total items)
When I try to create session with postman
http://169.254.21.xxx:8100/session
BODY {
"capabilities": {}
}
It logs this.
t = 70.72s Find the Application 'com.apple.springboard'
Then 60 sec later logs this
t = 130.74s Requesting snapshot of accessibility hierarchy for app with pid 62
then I can get sessionId. Why does it take 60 sec after this "Find the application" log.
This 60 sec waiting always happens in first try. After first try it works normally. But when i termiate xcodebuild process and start again. This issue start again.
Try to some cap. in appium readme some combianations or one by one. But i think they are not working on here
http://169.254.21.xxx:8100/session
BODY {
"capabilities": {
"bundleId": "com.apple.Preferences",
"wdaLaunchTimeout": 10000,
"newCommandTimeout": 10000,
"commandTimeouts": "10000",
"shouldUseSingletonTestManager": false,
"waitForIdleTimeout": 0,
"wdaEventloopIdleDelay": 3
"waitForQuiescence": false
}
Here is the full logs of other attempt. It is same, try it hundred times.
`xcodebuild -allowProvisioningUpdates -project /Users/xxxxxx/projects/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination platform="iOS,id=00008020-001974xxxxx" test
2022-10-18 16:52:09.595 xcodebuild[17768:262218] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-10-18 16:52:09.595 xcodebuild[17768:262218] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
Command line invocation:
/Applications/Xcode-13.4.app/Contents/Developer/usr/bin/xcodebuild -allowProvisioningUpdates -project /Users/xxxxxx/projects/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination platform=iOS,id=00008020-00197451223A002E test
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
note: Using new build system
note: Planning
Analyze workspace
Create build description
Build description signature: be392f989b1227654646cf53b2b0be32
Build description path: /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Intermediates.noindex/XCBuildData/be392f989b1227654646cf53b2b0be32-desc.xcbuild
note: Build preparation complete
note: Building targets in dependency order
WriteAuxiliaryFile /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentLib.build/WebDriverAgentLib-all-non-framework-target-headers.hmap (in target 'WebDriverAgentLib' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
write-file /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentLib.build/WebDriverAgentLib-all-non-framework-target-headers.hmap
ProcessInfoPlistFile /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/Info.plist /Users/xxxxxx/projects/WebDriverAgent/WebDriverAgentLib/Info.plist (in target 'WebDriverAgentLib' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
builtin-infoPlistUtility /Users/xxxxxx/projects/WebDriverAgent/WebDriverAgentLib/Info.plist -producttype com.apple.product-type.framework -expandbuildsettings -format binary -platform iphoneos -requiredArchitecture arm64 -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/Info.plist
CodeSign /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework (in target 'WebDriverAgentLib' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
export CODESIGN_ALLOCATE=/Applications/Xcode-13.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
/Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework: replacing existing signature
ProcessProductPackaging "" /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/WebDriverAgentRunner.xctest.xcent (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
}
WriteAuxiliaryFile /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/WebDriverAgentRunner-all-non-framework-target-headers.hmap (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
write-file /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/WebDriverAgentRunner-all-non-framework-target-headers.hmap
Copy /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude *.tbd -bitcode-strip all -bitcode-strip-tool /Applications/Xcode-13.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip -resolve-src-symlinks /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks
/Applications/Xcode-13.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentLib.framework/WebDriverAgentLib -r -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
ProcessInfoPlistFile /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Info.plist /Users/xxxxxx/projects/WebDriverAgent/WebDriverAgentRunner/Info.plist (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
builtin-infoPlistUtility /Users/xxxxxx/projects/WebDriverAgent/WebDriverAgentRunner/Info.plist -producttype com.apple.product-type.bundle.ui-testing -expandbuildsettings -format binary -platform iphoneos -additionalcontentfile /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Intermediates.noindex/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentRunner.build/ProductTypeInfoPlistAdditions.plist -requiredArchitecture arm64 -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Info.plist
CodeSign /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
export CODESIGN_ALLOCATE=/Applications/Xcode-13.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
/Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework: replacing existing signature
GenerateDSYMFile /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest.dSYM /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
/Applications/Xcode-13.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner -o /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest.dSYM
CodeSign /Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxx/projects/WebDriverAgent
export CODESIGN_ALLOCATE=/Applications/Xcode-13.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
/Users/xxxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest: replacing existing signature
CodeSign /Users/xxxxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
cd /Users/xxxxxxx/projects/WebDriverAgent
export CODESIGN_ALLOCATE=/Applications/Xcode-13.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
/Users/xxxxxxe/Library/Developer/Xcode/DerivedData/WebDriverAgent-bhblgbvzcmixaldopxqragzuswth/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app: replacing existing signature
Testing started
2022-10-18 16:52:19.287213+0300 WebDriverAgentRunner-Runner[88728:5746655] Running tests...
Test Suite 'All tests' started at 2022-10-18 16:52:19.746
Test Suite 'WebDriverAgentRunner.xctest' started at 2022-10-18 16:52:19.747
Test Suite 'UITestingUITests' started at 2022-10-18 16:52:19.747
t = nans Suite Set Up
2022-10-18 16:52:19.765902+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
KeyboardAutocorrection
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.766358+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
"KeyboardAutocorrection_changedAt"
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.766764+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
"KeyboardAutocorrection_buildAtChange"
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.767159+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
"KeyboardAutocorrection_previousValue"
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.767520+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
"KeyboardAutocorrection_analyzedAt"
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.776144+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
KeyboardPrediction
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.776555+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
KeyboardShowPredictionBar
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.777206+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
DidShowGestureKeyboardIntroduction
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
2022-10-18 16:52:19.777649+0300 WebDriverAgentRunner-Runner[88728:5746655] [User Defaults] Couldn't write values for keys (
DidShowContinuousPathIntroduction
) in CFPrefsPlistSource<0x280759e80> (Domain: com.apple.keyboard.preferences, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
Test Case '-[UITestingUITests testRunner]' started.
t = 0.00s Start Test at 2022-10-18 16:52:19.781
t = 0.00s Set Up
2022-10-18 16:52:19.783028+0300 WebDriverAgentRunner-Runner[88728:5746655] Built at Sep 13 2022 13:18:10
2022-10-18 16:52:19.794985+0300 WebDriverAgentRunner-Runner[88728:5746655] ServerURLHere->http://xxxxxx:8100<-ServerURLHere
2022-10-18 16:52:19.795465+0300 WebDriverAgentRunner-Runner[88728:5746825] Using singleton test manager
2022-10-18 16:52:33.112278+0300 WebDriverAgentRunner-Runner[88728:5746655] Getting the most recent active application (out of 1 total items)
t = 13.35s Find the Application 'com.apple.springboard'
t = 73.35s Requesting snapshot of accessibility hierarchy for app with pid 62
2022-10-18 16:58:30.052277+0300 WebDriverAgentRunner-Runner[88728:5746655] Getting the most recent active application (out of 1 total items)
t = 370.27s Find the Application 'com.apple.springboard'
t = 370.28s Requesting snapshot of accessibility hierarchy for app with pid 62
`
Again first try 73-13=60 sec. second try is like 1 ms
The text was updated successfully, but these errors were encountered: