Jump to content

Cannot get IEGetObjByName


Recommended Posts

Hi Team,

I know this is a old issue but cannot find a post that gave a solution so I am asking for your help.

The IE element does not have Object Name, only 'Type' and 'data-automationid.'

Heres the screenshot. So what do I use to get either the 'Type' and 'data-automationid.' so I can click the 'Log in' button?

image.thumb.png.a214ee6986e8b31354f5e020672ec81e.png

Here's the code, I have tried most IE

#include <IE.au3>
#include <MsgBoxConstants.au3>

Call ("signIn")

Func signIn ()
Global $oIE = _IECreate ("https://login.xero.com/identity/user/login?")

Local $username = _IEGetObjByName ($oIE,"Username")
Local $password = _IEGetObjByName ($oIE,"Password")
Local $button = _IEGetObjByName ($oIE,"button")
;Local $button1 = _IEGetObjById ($oIE,"submitcodebutton")
;Local $button1 = _IEFormElementGetCollection ($oIE,"auth-submitcodebutton")
;Local $button1 = _IEFormElementGetObjByName ($oIE,"auth-submitcodebutton")

_IEFormElementSetValue ($username,"techngo")
_IEFormElementSetValue ($password,"password")
_IEAction($button, "click")

Sleep(20000)

;Complete logging in with the authenticator app
MsgBox($MB_SYSTEMMODAL, "authenticator", "Enter the 6 digit from phone", 10)
Sleep(2000)


;CLICK LOGIN BUTTON
;Local $button1 = _IEGetObjByName ($oIE,"auth-submitcodebutton")
;Local $button1 = _IEGetObjById ($oIE,"auth-submitcodebutton")
;Local $button1 = _IEGetObjById ($oIE,"data-automationid")
;Local $button1 = _IETagNameGetCollection ($oIE,"auth-submitcodebutton")
Local $button1 = _IETagNameGetCollection ($oIE,"data-automationid")
_IEAction($button1, "click")


EndFunc
 

image.thumb.png.a54407bdb1fad9edc73f72e5e50b7d88.png

 

 

 

Link to comment
Share on other sites

It works for me :

#include <IE.au3>

Global $oIE

signIn()

Func signIn()
  $oIE = _IECreate("https://login.xero.com/identity/user/login?")
  Local $username = _IEGetObjByName($oIE, "Username")
  Local $password = _IEGetObjByName($oIE, "Password")
  _IEFormElementSetValue($username, "techngo")
  _IEFormElementSetValue($password, "password")
  Local $button = _IETagNameGetCollection($oIE, "button", 0)
  ;Local $button = _IEGetObjByName($oIE, "button") ; that also work for me

  _IEAction($button, "click")

  _IELoadWait ($oIE)

EndFunc   ;==>signIn

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...