TestComplete can recognize alert view controls of iOS Open Applications. This allows you to simulate actions on alert views using their methods and properties.
Alert view controls can include two types of objects: Buttons and Fields. Fields allow you to enter text; buttons are used to make a choice. Alert views also include a title and an optional message. For more information on getting an alert view’s title and message, see Getting Alert View Title and Message
It may take time for the alert view to appear. You can delay script execution until it becomes active. For more information on waiting for iOS objects, see Waiting for Objects in iOS Applications topic.
When entering text in fields or touching buttons, you can address them using their captions. Depending on the Use case-sensitive parameters project option, TestComplete treats the captions of buttons and fields as case-sensitive or case-insensitive. By default, this option is turned off, so you can ignore the letter case:
If the Use case-sensitive parameters option is checked, you need to use the appropriate case when specifying the captions:
alertview.TouchButton("Button") // Correct
alertview.TouchButton("button") // Incorrect!!!
Field text may change depending on the current application context. So, it is useful to address it only by the constant part of the text. To specify variable parts of text, you can use wildcard characters (* and ?) or regular expressions. The asterisk (*) corresponds to a string of any length (including an empty string), the question mark corresponds to any single character (including none). To specify more complicated parts of a caption, use regular expressions.
For example, your tested application’s alert view contains the UserName field whose contents depend on the user who is working with it: the text may be User1, TestUser, or Enter user name, if no user is logged in. In order to ensure recognition of the UserName field, you can replace the variable parts of the text with the * wildcard:
In this example, we placed a wildcard on both sides of the word User, since it can either precede or follow other text.