Example7. Setting the alarm by scrolling the wheel control

(Clock App)

This is an example of setting the alarm to 9 am in the Android clock app.

In this example, you can learn how to use Loop Content and If Content actions.

Step1. Create a new step, select the "Touch" action, select OD in the device screen analysis tool, and then drag and drop the "+" on the screen to add it as a UIObject of the step.

Step2. Create a new step, select the "Loop UIObject" action, select OCR from the device screen analysis, and then drag and drop "9" to add it as the step's UIObject. After that, in the Attributes tab, change the comparator to NOT EXISTS. Since the time ranges from 1 to 12, we set the limit to 12 so that the child step can be repeated 12 times.

Step3. Create a child step, select the "Scroll" action, analyze the screen while manipulating it so that a number less than 9 is displayed on the device screen, and then select "Custom Box" among the screen analysis tools. Designate the area corresponding to “hour” by dragging and add it as a UIObject of the child step by dragging and dropping it.

Step4. As shown in the picture below, 9 o'clock is displayed on the screen even at 8 o'clock and 10 o'clock. As shown in the picture, if the set time is 8 o'clock, the "hour" area must be moved down by 1 space to make it 9 o'clock. Write from 8 o'clock.

Create a new step, select the "If UIObject" action, select OCR with the device screen analysis tool, and then drag and drop "7" on the screen to add it as a UIObject.

Step5. Right-click the If UIObject action step, click the Insert child button to create a child step and select the "Scroll" option. After screen analysis, select "Custom Box" from the screen analysis tools, specify the area corresponding to "hour" in the alarm time by dragging, and add it as a UIObject of the child step by dragging and dropping it.

Step6. Below, write the case where the set time is 10 o'clock. Create a new step, select the "If UIObject" action, select OCR among the device screen analysis tools, and then drag and drop "11" on the screen to add it as the step's UIObject.

Step7. Create a child step, select the "Scroll" action, select "Custom Box" as the screen analysis tool, specify the area corresponding to "hour" during the alarm time by dragging, and add it as a UIObject of the child step by dragging and dropping. To set the alarm time to 9 o'clock, set the direction to DOWN because "hour" must go up one space.

Note) In the attributes of Scroll action, direction means the direction in which the finger moves when manipulating the device with his/her hand. For this situation, set the direction to DOWN because the number 9 is centered in the time domain by touching the number 10 with your finger to lower it.

Step8. Create a new step, select the "Touch" action, select OCR among the device screen analysis tools, and then drag and drop "Save" on the screen to set it as the UIObject of the step.

Step9. Change the device connected to Stego to the screen when writing the first step and run the scenario.

Last updated