How to take user input at run time

Hi,
i am automating a mobile application, in which i want to take user input at run time ie OTP in password field.
does it possible in katalon?

Hi Springct,

You can check out some Katalon docs on the Mobile.setText function: https://docs.katalon.com/katalon-studio/docs/mobile-set-text.html

Hope this helps,

Chris

1 Like

Chris Trevarthen said:

Hi Springct,

You can check out some Katalon docs on the Mobile.setText function: https://docs.katalon.com/katalon-studio/docs/mobile-set-text.html

Hope this helps,

Chris

Sorry i think u didnt get me…
i want to take input from user at “Run Time”.
for ex. Script should ask me to enter otp on console and i can use that in my password field.

Hi Springct,

You should be able to set an environment variable for the password (e.g. export PASSWORD=‘secret’) on the command line and then access it in your test code via:

def password = System.getenv('PASSWORD')
Mobile.setText(findTestObject('My Password Field'), password)

Hope this helps,

Chris