Android secure flag: Programatically iterate over child elements

Does anyone have example Groovy code to iterate over all childs of a Test object and print out the children?

You can get the parent of an TestObject with “.getParentObject()”. But I dont see any method for retrieving the children or siblings.

Problem I have is that there is a page flagged as “secure”. The page contains 6 input boxes for the a pin code.
When I use the “Spy Mobile” or “Record Mobile” option it only detects those 6 boxes as ImageView objects.
Even after tapping on the ImageView object (one part of the 6 digit pin code) it still records the test object as an ImageView. I cannot set text (number) on an ImageView. Usually when you tap on an ImageView it transforms into an EditText or some other element in which you can set the value. It does not happen in the Spy or Record Mobile browser.

So I want to know, by programmatically iterating the children of the parent element, which test object i have to use to set the value on the 6 boxes.

The page flagged as “Secret”:

Katalon test objects:
49

This may not be as helpful but may get you going on your way. I had a similar issue with sending text to a specific field in my site. I ended up importing a webdriver lib that allowed me to Send.Keys(Keys.LEFT_BUTTON). doing this is the only way I am able to set text to a field so maybe this may help you

1 Like

@ehernandez Can you remember the type of the object you which you used to sendkeys to set the value? Also am ImageView or Icon etc?
Which webdriver lib did you use? How to import it?

Sure, like I said, not sure if this would work for you but it could guide you in the right path
I use it for my Web testing but i’ve seen this for mobile as well

import org.openqa.selenium.Keys as Keys

WebUI.sendKeys(findTestObject(‘Your_Object_Goes_Here’), Keys.chord(Keys.ARROW_RIGHT))

In this case, I was sending the key for right arrow in order to control a scroll bar but this was also used to enter text into a very badly built field

@ehernandez Thank you for the tip!