How to automate a OTP

I need help in automating OTP without waiting for SMS we get and is there a work around for entering any 4 digit random number and proceed with testing.


@swapna1 If any random number can work as OTP in your test environments then you can try this :

def otp = org.apache.commons.lang.RandomStringUtils.randomNumeric(3)

WebUI.sendKeys(findTestObject('login/otp_field'), otp)

swapna1 you can check with the developer to create an always passed OTP example “0000”. You can’t do or workaround (by entering any 4 digits random number and proceed with testing) without supported always passed key.