How can I get an OTP code and copy it?

Hello

I would love a solution to the problem I have.
I do several processes on a shopping site.
In some processes, an OTP code is received on the customer’s phone. I need to somehow receive this code and put it on the website.
I’m not talking about mobile automation tests, it’s about a regular desktop site.
Is there any utility that can be used or another way to get this code?

Hi @mironb

You can use the Input dialog box activity to get the input from the user, they can enter the otp there and it will be save to a variable. By using type into activity bot can enter the otp code to the website.

Hope it helps!!

@mkankatala
Maybe I didn’t explain myself well.
After I enter my phone number on the website I Test, I receive an OTP code on my mobile device.
I need this code somehow to get and put on the site.
My question, is there any tool I can get this code automatically.

Hi @mironb

For this you can use Appium tool

@Archana_Gulli

Can you give more details please ?

Hey @mironb
To get the OTP code you need sms gateway like twilio or something else.
I used it to retrieve OTP code sent via email, robot took code and placed it to the website.

1 Like

What is twilio and How to use it ?
Thanks

Refer to this blog :point_down: :point_down:, Let me know if you need any further help.

Sorry, if I remember correctly twilio worked fine but blocked OTP codes from Amazon.
SMSGO worked without any issues.

Hi @mironb

For more details please refer following steps:

  1. Install and configure Appium on your local machine, also install the necessary dependencies, set up the desired mobile platform (Android or iOS), and start the Appium server.

  2. Create a mobile automation project
    ->Set up a new project in your preferred programming language (e.g., Java, C#,
    Python) that uses the Appium client library.

  3. Write code to retrieve OTP
    ->Within your Appium project, write code to automate the process of opening the messaging app on your mobile device, retrieving the OTP code from the message, and sending it to your UiPath automation.

Note:You’ll need to use the appropriate Appium APIs and mobile platform-specific actions to achieve this.

  1. After your Appium project is set up and the code to retrieve the OTP is working, you can integrate it with your UiPath workflow.
    (This can be done by executing the external Appium project as a separate process from UiPath, using the “Start Process” or “Invoke Power Shell” activities in UiPath.)

  2. Once the OTP code is retrieved by the Appium project, you can pass it to the website in UiPath using activities such as “Type Into” or “Set Text” to input the OTP code into the appropriate field.

Thanks

1 Like