How to get the type of input field [Number, alphanumeric.... etc]

Hi Guyz,

In manual we usually test the type of Input field as well… like if phone number field is accepting alphanumeric values or not, if it is accepting more or less than 10 digits… an many more…

Can we automate this kind of scenarios by katalon…???

If it is possible, please help me out… have strict timeline… and have to deliver the script.

Thanks!

to get type use

WebUI.getAttribute(testObject, 'type')

to test for actual type use

WebUI.verifyElementAttributeValue(testObject, 'type', TYPE_TO_TEST, 3)

Will it work even if I don’t have ‘type’ attribute in object’s properties… in mobile app’s Element??

I have written this code…

Mobile.tap(findTestObject(‘Sign up/android.support.v7.app.ActionBarTab4’), 3)

Mobile.tap(findTestObject(‘Sign up/android.widget.Button1 - SIGN UP’), 3)

String Type = WebUI.getAttribute(findTestObject(‘Object Repository/Sign up/android.widget.EditText0’), ‘type’)

println(Type)

WebUI.verifyElementAttributeValue(findTestObject(‘Object Repository/Sign up/android.widget.EditText0’), ‘type’, String, 3)

And got Error…

Unable to get attribute ‘type’ of object ‘Object Repository/Sign up/android.widget.EditText0’ (Root cause: com.kms.katalon.core.webui.exception.BrowserNotOpenedException: Browser is not opened

sorry, my fault instead of WebUI use Mobile so :

Mobile.getAttribute(testObject, 'type')Mobile.verifyElementAttributeValue(testObject, 'type', TYPE_TO_TEST, 3)