-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
handle "Paste from other apps" alert become extremely slow( cost 3 min) with wait.until(ExpectedConditions.alertIsPresent()) and base.getIosDriver().switchTo().alert().accept() after upgrading the xcuitest driver to version 6.0.0 (also tried version 7.1.0, same issue exists)) #19814
Comments
Try to activate the springboard app before interacting with the alert as described in https://github.com/appium/appium-xcuitest-driver/blob/master/docs/guides/troubleshooting.md#interact-with-dialogs-managed-by-comapplespringboard |
@Dan-Maor Do you have an idea what exactly may cause the delay? I've prepared appium/WebDriverAgent#851, but I'm also not 100% sure it is going to address it if I don't know the cause |
I sometimes observed a "round" 1 minute duration when testmanagerd fails to open a direct connection to the application under test with the action succeeding in the way of a fallback. I'm not testing with simulators often, this is a behavior I've seen with real devices (haven't encountered it for a long time though), however it might be a similar case here. @Rosepotato will you be able to attach the simulator syslog captured while the scenario is performed? Regardless, this looks like something specific in this app's scenario since I'm unable to reproduce the issue with various Springboard alerts (allow notification, pasteboard, location) with a simulator or a real device. Keep in mind, I am using Xcode 15.2 and don't have Xcode 15.0 available at the moment, so perhaps it is worth checking whether updating to Xcode 15.2 would help. |
@Dan-Maor I have attached the full log including the IOSSimulatorLog. You can search the logs by "alert/text" and "alert/accept". And I use selenium-java version 4.17.0 and java-client version 9.1.0.
|
@mykola-mokhnach I have tried this way mentioned in (https://github.com/appium/appium-xcuitest-driver/blob/master/docs/guides/troubleshooting.md#interact-with-dialogs-managed-by-comapplespringboard), still need 1 min to accept the alert.
|
I've actually asked to try a different workaround:
|
@mykola-mokhnach Switching between test app and springboard app is not a good way for my whole test logic. I'd prefer to keep my own test app in active status. Are there anything significant changes since xcuitest driver version 6.0.0? I see that wda 6.0 is bound to xcuitest driver since version 6.0.0. Not sure if issue comes out of new wda. The strange thing is that pasteboard alert is handled quickly just before the xcuitest driver version 6.0.0. |
I assume this is the main cause:
|
Thanks for providing the logs @Rosepotato
I also noticed that you're capturing a video during your test, and during the paste attempt screenshots are failing as well:
I wrote a simple app which access the UIPasteboard in a loop Accessing the pasteboard on the main thread of an app - given that UI operations and interactions (elements retrieval and screenshots) rely on the target application main queue to be idle - could be the reason for @Rosepotato Are you are you accessing |
@Dan-Maor Good to know that you can reproduce it. I have confirmed with our iOS developer that we access UIPasteboard on the main thread of our application. I attached a video. You can have a check. SPND2698_sendMemberRequestByPasteFromClipboard.sendMemberRequestByPasteFromClipboard.mp4 |
Thanks for confirming. I find it quite strange that this scenario hangs only on WDA above 6 since I am able to reproduce the flow using older WDA releases as well. If the application's main run loop is held by repeated calls to pasteboard then it stands to reason that Will you be able to repeat the flow with an older XCUITest driver version while capturing the syslog and attach it here? Perhaps I could spot a difference in the behavior that way. Please use the same Xcode and OS versions. |
@Dan-Maor The main difference between v5 and v6 version of the driver is that the logic for active app detection has been optimised. Now we assume the active app is always the app under test as soon as it is in Running foreground state instead of checking to which app a random on-screen pixel belongs. |
@Dan-Maor What's the conclusion for this issue? not a bug, just a intended changes in xcuitest v6? Do I need to provide the syslog with older version again? |
@Rosepotato I tend to agree with @mykola-mokhnach that the new behavior is intended, so syslog from v5 is not needed at this point. |
@Dan-Maor @mykola-mokhnach still cost 3 mins after activate sprintboard app whether by mobile: activateApp or getIosDriver().activateApp("com.apple.springboard") before interact with the pasteboard alert on xcuitest version v7.1.0.
|
@Dan-Maor @mykola-mokhnach Use mobile: activateApp to activate the springboard app, then call mobile: alert to accept the alert, still cost around 1 mins per alert request, I think it's not acceptable for so slow response. Uploading alertLogActivateApp.txt…
|
@Dan-Maor @mykola-mokhnach I tried another suggested way as the following steps (didn't call "mobile: activateApp" here), still cost more than 1 min to accept the alert.
|
@Dan-Maor I attached a log file with older xcuitest version 5.16.1 which has quick response for alert handling. Hope it's helpful. |
@Rosepotato can you please try again using xcuitest version 7.1.1? (released a few hours ago) which contains @mykola-mokhnach 's fix, in the reproduction scenario I created it seems to have fixed the issue. If the issue still occurs, please let us know and if possible attach the syslog of the execution. |
I am reproducing this problem as well. When the application starts, the notification alert appears on the authorization screen and in the inspector the structure of the authorization screen, not the dialog with the alert. Version 7.1.2 did not fix the problem. On version 5.16.1 it works with no problem. This causes all tests to stop working. Judging by Rosepotato's posts, the old mechanism was more efficient. I guess not so many people have upgraded and encountered the problem (usually you upgrade when the new Xcode/sumulator stops working on the old driver version). |
@Dan-Maor Great work! I tested the xcuitest v7.1.2. The alert handling response is much quicker(almost the same as that in xcuitest v5.16.1) 2024-02-26 02:13:30:454 - [HTTP] --> GET /session/a4180aac-f140-4780-a379-ead7b8007220/alert/text |
Do I have the most recent component updates?
Is the component officially supported by the Appium team?
Is there an existing issue for this?
Current Behavior
2024-02-20 03:33:16:234 - [HTTP] --> GET /session/2324dd1a-87cf-472d-97ec-8cbf70c6c40f/alert/text
2024-02-20 03:33:16:234 - [HTTP] {}
2024-02-20 03:34:16:644 - [HTTP] <-- GET /session/2324dd1a-87cf-472d-97ec-8cbf70c6c40f/alert/text 200 60411 ms - 110
2024-02-20 03:34:16:644 - [HTTP]
2024-02-20 03:34:22:450 - [HTTP] --> GET /session/2324dd1a-87cf-472d-97ec-8cbf70c6c40f/alert/text
2024-02-20 03:34:22:450 - [HTTP] {}
2024-02-20 03:35:22:748 - [HTTP] <-- GET /session/2324dd1a-87cf-472d-97ec-8cbf70c6c40f/alert/text 200 60298 ms - 110
2024-02-20 03:35:22:748 - [HTTP]
2024-02-20 03:35:22:751 - [HTTP] --> POST /session/2324dd1a-87cf-472d-97ec-8cbf70c6c40f/alert/accept
2024-02-20 03:35:22:752 - [HTTP] {}
2024-02-20 03:36:23:861 - [HTTP] <-- POST /session/2324dd1a-87cf-472d-97ec-8cbf70c6c40f/alert/accept 200 61110 ms - 14
Expected Behavior
Can get quick response when handle the alert as before.
e.g. on xcuitest driver version 5.16.1.
Minimal Reproducible Example
Environment
appium --version
): 2.5.1node --version
):v18.10.0npm
version (output ofnpm --version
):8.19.2Link to Appium Logs
No response
Further Information
No response
The text was updated successfully, but these errors were encountered: