web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Automating Login with OTP
Power Automate
Unanswered

Automating Login with OTP

(0) ShareShare
ReportReport
Posted on by 4

I am trying to automate the process of updating my NameCheap API IP Address using this bada$$ new tool from Microsoft, but when I get to the One-Time-PIN authentication for the login, after opening an input field for the OTP and pressing enter or the OK button, the field is not recognized any longer, breaking the automated login process. The Error that I get is:

"Form field with selector 'html > body > fragment:eq(1) > fragment-app-589adf22 > div > form > div > div > div > div:eq(0) > div > input' not found."

I have entertained the idea of getting the OTP before logging in, but this could cause a problem due to the fact that it is a time-based password. Any ideas of how to solve this?

 

My Flow follows (With Username, password, and screenshots removed for privacy)

 

@@flowname: 'Get_External_IP'
External.RunFlow FlowId: 'fdced696-193e-4cfc-9d67-c1db482337ef' @External_IP_Address=> External_IP_Address
# Start of autogenerated actions using the web recorder
@@timestamp: '11/18/2021 01:04:59'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.LaunchFirefox.LaunchFirefox Url: 'https://www.namecheap.com/' BrowserInstance=> Browser
@@timestamp: '11/18/2021 01:05:08'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PressButton.PressButton BrowserInstance: Browser Control: appmask['Recording']['button']
@@timestamp: '11/18/2021 01:05:10'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: Browser Control: appmask['Recording']['input'] Text: 'MYPASSWORD' Mode: WebAutomation.PopulateTextMode.Replace
@@timestamp: '11/18/2021 01:05:12'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: Browser Control: appmask['Recording']['input 2'] Text: 'MYUSERNAME' Mode: WebAutomation.PopulateTextMode.Replace
@@timestamp: '11/18/2021 01:05:12'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['span']
@@timestamp: '11/18/2021 01:05:12'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PressButton.PressButton BrowserInstance: Browser Control: appmask['Recording']['button 2']
Display.InputDialog Title: $'''One-Time PIN''' Message: $'''Enter the OTP value''' InputType: Display.InputType.Password IsTopMost: True UserInput=> OTP ButtonPressed=> ButtonPressed
# CURRENTLY UNABLE TO TYPE THE OTP ENTERED FROM PREVIOUS COMMAND INTO FIELD.
WebAutomation.PopulateTextField.PopulateTextFieldCloseDialog BrowserInstance: Browser Control: appmask['Recording']['input 3'] Text: OTP EmulateTyping: True UnfocusAfterPopulate: False Mode: WebAutomation.PopulateTextMode.Replace
@@timestamp: '11/18/2021 01:06:03'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PressButton.PressButton BrowserInstance: Browser Control: appmask['Recording']['button 3']
@@timestamp: '11/18/2021 01:06:09'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['a']
@@timestamp: '11/18/2021 01:06:13'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['span 2']
@@timestamp: '11/18/2021 01:06:16'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PressButton.PressButton BrowserInstance: Browser Control: appmask['Recording']['button 4']
@@timestamp: '11/18/2021 01:06:20'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['a 2']
@@timestamp: '11/18/2021 01:06:26'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['td']
@@timestamp: '11/18/2021 01:06:32'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.GetDetailsOfElement BrowserInstance: Browser Control: appmask['Recording']['td'] AttributeName: 'innertext' AttributeValue=> innertext
IF innertext <> External_IP_Address THEN
@@timestamp: '11/18/2021 01:06:57'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['a 3']
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: Browser Control: appmask['Recording']['input 4'] Text: External_IP_Address EmulateTyping: True UnfocusAfterPopulate: False Mode: WebAutomation.PopulateTextMode.Replace
@@timestamp: '11/18/2021 01:07:39'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PopulateTextField.PopulateTextField BrowserInstance: Browser Control: appmask['Recording']['input 5'] Text: 'MYPASSWORD' Mode: WebAutomation.PopulateTextMode.Replace
@@timestamp: '11/18/2021 01:07:39'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.PressButton.PressButton BrowserInstance: Browser Control: appmask['Recording']['button 5']
Display.ShowMessageDialog.ShowMessageWithTimeout Title: $'''IP Address Updated''' Message: $'''The NameCheap API Address was not a match, but was updated to the current External Address of : %External_IP_Address%''' Icon: Display.Icon.Information Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: True Timeout: 3 ButtonPressed=> ButtonPressed3
ELSE
Display.ShowMessageDialog.ShowMessageWithTimeout Title: $'''Current IP Address''' Message: $'''The current External IP Address matches. No need to change.''' Icon: Display.Icon.Information Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: True Timeout: 3 ButtonPressed=> ButtonPressed2
END
@@timestamp: '11/18/2021 01:07:49'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['a 4']
@@timestamp: '11/18/2021 01:07:52'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['a 5']
@@timestamp: '11/18/2021 01:07:55'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['a 6']
@@timestamp: '11/18/2021 01:07:57'
@@source: 'Recorder'
@@recordertype: 'Web'
@@culture: 'en-US'
WebAutomation.Click.Click BrowserInstance: Browser Control: appmask['Recording']['span 3']
# End of autogenerated actions using the web recorder

# [ControlRepository][PowerAutomateDesktop]

 

 

 

 

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    So typically, if I am having a problem with changing UIs, my next step is to try using send keys. Can you tab to the needed field and enter the second factor authentication?

  • TheCodeGeek Profile Picture
    4 on at

    No, because it doesn't seem to detect my pressing of the tab, plus, the field is already selected, so I would end up pressing Tab, then Shift-Tab. Thank you for the suggestion though.

     

  • TheCodeGeek Profile Picture
    4 on at

    I believe that the problem lies in the process of entering the text into the specific field which is referred to by an app fragment code which differs every time. I have been using Firefox because that is where my PW's are stored, but I will try Edge today.

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    I have had the most luck with UI automation with Chrome...if it's an option.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard