The Mobile Screen is essentially an emulator that shows your connected device and has extra test-related tools. We’re going to spend a lot of time in this screen this month.
What can you do with the Mobile Screen?
- Select the connected device that will show in the Mobile Screen.
- Manipulate the screen during recording.
- Simulate hardware buttons: back, home, menu, volume and power.
- Take screenshots.
- Record and playback complex gestures, like a three finger swipe, thumb-and-finger rotation, pinching, zooming and so on.
- Add images and create checkpoints for image-based testing.
- Use the Object Spy to find objects in instrumented apps.
- Run TestedApps.
Changes on the device show in the Mobile Screen, and visa-versa. Changes in the Mobile Screen can be recorded.
Showing the Mobile Screen
As per yesterday’s blog, the Mobile Screen comes up by using the Show Mobile Screen button. If you don’t have it set up, just right-click the TestComplete toolbar and select Customize. From the Commands tab, select the Mobile category and drag the Show Mobile Screen command to the toolbar.
If there is a single connected device, the Mobile Screen pops up. If there are 2 or more devices, the Select Current Device dialog displays. Pick your device and click Connect or OK.
You can change devices later from the Select Device dropdown in the toolbar. Here’s a quicky map of the interface:
Note on iOS vs. Android behavior: Android does not require preparing an instrumented application in order to show the Mobile Screen. This allows you to work with the desktop and with apps that you don’t have code for. You can use image-based testing to recognize UI elements, such as buttons on the desktop. As of this writing, iOS requires a running instrumented app to use the Mobile Screen. The Mobile Screen also displays different options for each OS. In the screenshot, Android is on the left, iOS on the right. Android has additional options for gestures, screen rotation and hardware buttons along the bottom.
When the Mobile Screen has a connected device running, the Run Apps drop down has any TestedApps appropriate for the OS you’re running. The Android screenshot below shows a couple of TestedApps ready to run. Selecting a TestedApp from the list refreshes the device with a new copy of the app and runs it.
The device hardware buttons for Android are all replicated at the bottom of the Mobile Screen so that you can record basic navigation during the test.
Note: Clicking the buttons left-to-right translates to Device methods during recording. The mobile key constants used in the PressButton() method are defined in the online help.
Mobile.Device.PressBack(); Mobile.Device.PressHome(); Mobile.Device.PressButton(mbkAppSwitch); Mobile.Device.PressButton(mbkVolumeDown); Mobile.Device.PressButton(mbkVolumeUp); Mobile.Device.PressButton(mbkPower);
Wrap Up
We went on a quick tour of the Mobile Screen today and looked at its features and OS-related particulars. Tomorrow we’ll catch up with iOS and setup an iPhone device for testing.
The post Using the Mobile Screen appeared first on Falafel Software Blog.