12/28/2023 0 Comments Invoke ipad pro split screen![]() getDockIconRect just takes an app name, and returns the position of its dock icon in the screen: There is an interesting helper method here. Rectangle photosIconRect = getDockIconRect(“Photos”) save the location of the icons in the dock so we know where they are //when we need to drag them later, but no longer have access to them as //elements Then we re-launch Reminders, so that it is active and ready to share the screen with Photos. In the next step of this flow, we figure out where the Photos icon is, and save that information for later. ImmutableMap pressHome = ImmutableMap.of(“name”, “home”) ĭriver.executeScript(“mobile: pressButton”, pressHome) go to the home screen so we have access to the dock icons terminate photos and launch reminders to make sure they’re both the most recently launched appsĭriver.executeScript(“mobile: terminateApp”, ImmutableMap.of(“bundleId”, PHOTOS)) ĭriver.executeScript(“mobile: launchApp”, ImmutableMap.of(“bundleId”, REMINDERS)) Then, we go back to the Home Screen, so that the dock is visible: At this point, we’ve launched both the apps we want to work with, so they are both the most recently-launched apps, and will both show up in the recent apps section of the dock. What we want to do next is actually terminate Photos, and launch Reminders. ![]() When we begin our test, the Photos app will be open. In this setUp method, we also construct a WebDriverWait, and store the screen dimensions on a member field, because we’ll end up using them frequently. Size = driver.manage().window().getSize() Because we’re going to open up Photos on the right, we’ll actually launch it first in our test, so that we can close it down, open up Reminders, and then open up Photos as the second app.ĭesiredCapabilities capabilities = new DesiredCapabilities() ĬtCapability(“platformName”, “iOS”) ĬtCapability(“platformVersion”, “13.3”) ĬtCapability(“deviceName”, “iPad Pro (12.9-inch) (3rd generation)”) ĬtCapability(“app”, PHOTOS) ĬtCapability(“simulatorTracePointer”, true) ĭriver = new IOSDriver(new URL(” “), capabilities) In our case, we’ll want Reminders on the left and Photos on the right. Let’s take a look at the setup for an example where we’ll load up both Reminders and Photos in Split View. ![]() The best way to make this happen is to ensure that it has been launched recently in fact, most recently apart from the currently-running app. Ensuring applications are in the dockįor our strategy to work, we need the icon of the app we want to open in Split View in the dock. We’re going to describe how to achieve above steps. Telling Appium which of the apps in the Split View we want to work with at any given moment.Executing the correct gestures to show the dock and drag the app icon to trigger Split View.Ensuring both apps have been opened recently enough to show up in the dock.Basically, we need to worry about these things: ![]() Unfortunately, there’s no single command to make this happen, and we have to use a lot of tricky techniques to mirror the appropriate user behavior. Let’s now discuss how we can walk through this same series of steps with Appium to get ourselves into Split View mode, and further be able to automate whichever app of the two we desire. Of course, both apps must be designed to support split view for this to work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |