The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach. |
When testing hybrid applications, you interact with them in the same way you interact with native mobile applications.
Actions against controls in WebViews are performed asynchronously. This means that TestComplete does not wait for the operation to finish. For more information, see the Possible Issues With Hybrid Mobile Applications (Legacy) topic. |
Simulating Touch Actions
You can use TestComplete to simulate touch actions over controls in your applications in several ways:
-
TestComplete adds the
Touch
,LongTouch
andDrag
actions to all controls. These actions are simulated against the specified control and the simulation is not affected even if you change the control position. For information on simulating touches, see the Simulating Basic Touch Actions Over Android Open Applications (Legacy) or Simulating User Actions on iOS Applications (Legacy) topic.Note: Click
method is also added to controls in WebView, so that tests for web and hybrid mobile applications are more uniforms. It works in the same way as Touch method. -
TestComplete also adds the
Touch
,TouchAndHold
,Swipe
andDrag
actions to the Device object. These actions are simulated against the device screen. They simulate actions relative to screen coordinates, and you need to change your test if the screen layout changes. For more information on simulating touches, see the Simulating Basic Touch Actions Over Android Devices (Legacy) or Simulating User Actions on iOS Applications (Legacy) topic. -
You can use TestComplete to record and play back gestures on Android devices. Gestures can be used to simulate more complex actions, such as Pinch close or Pinch open. TestComplete records and simulates gestures relative to screen coordinates and only on those devices that support the touch interface.
Simulating Text Input
TestComplete provides the following ways to simulate test input in your application:
-
Depending on the control's class, TestComplete may provide specific methods and properties that you can use to simulate text input. For example, TestComplete provides the
SetText
method for text boxes. This method works for both Web and native controls. TestComplete does not simulate input letter by letter. For information on what method to use to simulate text input, see the topics that describe the corresponding controls. -
TestComplete provides the
Keys
method for all controls of your application and for the AndroidDevice and iOSDevice objects. The AndroidObject.Keys and iOSObject.Keys methods first activate the control, and then type text. The AndroidDevice.Keys and iOSDevice.Keys methods type text in the active control. These methods simulate text input letter by letter. You can use special keys like Ctrl or Backspace.Note: Make sure that the TestComplete Android Agent keyboard is available if you plan to enter local symbols on Android devices. See the Simulating Local Symbol Input (Legacy) topic for more information. -
TestComplete can access native methods and properties of the tested application. You can use these methods to enter text in your application.
You can find more information on simulating text input in the following topics:
Simulating User Actions Over Device
When users work with application, they may perform actions over device. For example, they may turn the device to change its orientation, or use physical buttons. For more information on simulating these actions in your tests, see the following topics: