WebDriverAgent runner cannot be activated with activateApp
See original GitHub issueProblem
Hello. I am trying to activate the WebDriverAgent app in iOS with no luck. What I want to do is open it and set something to clipboard and then bring my own app back.
Environment
- Appium version (or git revision) that exhibits the issue: 1.21
- Desktop OS/version used to run Appium: MacOS
- Mobile platform/version under test: iOS 14.6
- Real device or emulator/simulator: iPhone XS
- Appium CLI or Appium.app|exe: Appium CLI
Details
Before the iOS 14.6 I could set something to clipboard, without activating the WebDriverAgent, even thought the documentation advised for the opposite. Now after the upgrade, I followed the instructions to bring the WDA in foreground but a timeout occurs and nothing happens. Also, the same happens if I try to activate another app with the activateApp command, after the first timeout.
Link to Appium logs
https://gist.github.com/nikoskyr/41063dd279f6ee410b6f25ccf32da140
Code To Reproduce Issue [ Good To Have ]
driver().activateApp("com.facebook.WebDriverAgentRunner");
I also tried to change the WDA bundleId but the same problem happened.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Xcode is unable to correctly run W… | Apple Developer Forums
Xcode is unable to correctly run WebDriverAgent on iOS due to error: Too many instances of this service are already running.
Read more >how to send some String value to ios real device clipboard ...
Activate App command cannot launch the WebDriverAgent properly on some environments. It depends on XCTest framework by Apple. Then, you should ...
Read more >Troubleshooting - Appium
If you're running Appium.app. Update the app and restart. If you get a message saying the app can't be updated, re-download it from...
Read more >appium-xcuitest-driver - npm
Executes the given app on the device under test. If the app is already running then it would be activated. If the app...
Read more >Ios xctest mobile apps management - appium - Read the Docs
mobile: activateApp. Activates an existing application on the device under test and moves it to the foreground. The application should be already running...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tried with some iOS versions (15, 14.6 and 12.5.4(recent update for iOS 12)), iPad 15 and Xcode versions (10.3, 12.4 and 13). Then, probably not sure since, but XCTest framework changed the behavior. It seems
launch
andactivate
which are the endpoint of XCTest in WDA cannot launch the WDA process itself. e.g. https://developer.apple.com/documentation/xctest/xcuiapplication/2873317-activateFor instace, in the below line worked very slowly. Once they succeeded,
launch
andactivate
method by XCTest started to re-install WDA apps. The process was stopped. So, it seems ‘activate the app process’ seems broken or changed the behavior from Apple’s documentation. current master: https://github.com/appium/WebDriverAgent/blob/master/WebDriverAgentLib/Routing/FBSession.m#L202 A bit old one: https://github.com/appium/WebDriverAgent/blob/a1824895274c60798b506f31054e4ce1e0400c71/WebDriverAgentLib/Routing/FBSession.m#L213 I also tried WDA in 1.17.0.Anothe thisng. When i called the below
activateAppInfo
command when I manually bring WDA app forward by tapping the app icon, it returned the spring board instead of the WDA bundle id.I installed another WDA as different bundle id. Let assume this another one is WDA B. The former is WDA A. When I launched an appium session with the WDA A, the A was able to activate the WDA B. But WDA A was not able to activate the WDA A itself.
So, not sure since, but it seems XCTest framework itself behaved differently… For now, the blow steps are probably solid way.
@driver.activate_app 'com.apple.springboard'
@driver.find_element :accessibility_id, 'WebDriverAgentRunner-Runner'
and click itI’ll add this way in the documentation
@KazuCocoa thanks a lot for the detailed description of the problem. It is now understandable how the “problem” introduced at first place.
So at the time being the only solution-workaround is to launch the springboard and then open the WDA. I think we can close this issue!!