Jump to content

Recommended Posts

Posted

Am trying to automate injecting credential on the login form for all kind of Web application for IE. I know how to identify the form name by viewing the source code and using the method - _IEFormGetObjByName($ie, $form_Name).

I would like to know how to identify or get the form object for the web app where there is no form name tag for example below, for the is I have used - _IEFormGetCollection($ie, 0) to get the form object.

My Question is does it work for all kind of application "_IEFormGetCollection($ie, 0)" how to identify Index value? is it always 0? is there any better solution?

The final solution am looking for is find out form object, get the username, password field and inject credential and submit the form.

How to find out index value? for the forms which does not have form name field.

$login_form = _IEFormGetCollection($ie, 0)
$email_field = _IEFormElementGetObjByName($login_form, $form_UserName)
$pass_field = _IEFormElementGetObjByName($login_form, $form_password)
$login_button = _IEFormElementGetObjByName($login_form, $form_submitbutton)
_IEFormElementSetValue($email_field, $CmdLine[2])
_IEFormElementSetValue($pass_field, $CmdLine[3])
ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]","{Enter}")

OR
This works fine if the form has form name.
$login_form = _IEFormGetObjByName($ie, $form_Name)
$email_field = _IEFormElementGetObjByName($login_form, $form_UserName)
$pass_field = _IEFormElementGetObjByName($login_form, $form_password)
$login_button = _IEFormElementGetObjByName($login_form, $form_submitbutton)
_IEFormElementSetValue($email_field, $CmdLine[2])
_IEFormElementSetValue($pass_field, $CmdLine[3])
ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]","{Enter}")
  • Moderators
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

  Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Expand  

Moderation Team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

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
×
×
  • Create New...