Sign in to follow this  
Followers 0
Floppy

Help setting values into this form!

13 posts in this topic

#1 ·  Posted (edited)

Hello I'm trying to set values into the following form:

&lt;form action"" method="post"&gt;<p></p><p><br></p><p>&lt;input name="login_email" type="text"/&gt;</p><p>&lt;input name="login_password" type="password"/&gt;</p><p><br></p><p>&lt;/form&gt;</p>

I tried with this code:

<div>$IE = ObjCreate("Shell.Explorer.2")</div><div>GUICtrlCreateObj($IE,0,0,800,600)</div></p><p><div>_IENavigate($IE,"http://===.com/auth/form/login/")</div><div>$login_form = _IEFormGetCollection($IE)</div><div>$login_email = _IEFormElementGetObjByName($login_form,"login_email")</div><div>$login_password = _IEFormElementGetObjByName($login_form,"login_password")</div><div>_IEFormElementSetValue($login_email,"test",0)</div><div>_IEFormElementSetValue($login_password,"test",1)</div>

But it doesn't work because I get the following output:

--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidObjectType
--> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidObjectType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType

Please, can someone help me?

Thank you

Edited by FSoft

Share this post


Link to post
Share on other sites



Hi FSoft,

Do you have the URL of the form? If so I will take a crack at it...

Share this post


Link to post
Share on other sites

The url is this.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

something like?

#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$IE = ObjCreate("Shell.Explorer.2")
GUICreate("Embedded Web control Test", 640, 580, -1, -1,BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
GUICtrlCreateObj($IE,0,0,800,600)
_IENavigate($IE,"http://mygengo.com/auth/form/login/",0)
GUISetState()
_IELoadWait($IE)
$login_email = _IEGetObjByName($IE,"login_email")
$login_password = _IEGetObjByName($IE,"login_password")
_IEFormElementSetValue($login_email,"test")
_IEFormElementSetValue($login_password,"test")
MsgBox(0,'','The End')

Edit:

added include on top of script

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Output:

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType

Share this post


Link to post
Share on other sites

we apparently aren't getting identical results, for me it works fine, are you sure that you copied identical code?

post OS,IE and autoit version so that anyone who have that configuration to try to test it.


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Windows 7 SP1 32 bit

IE9

AutoIT v3.3.6.1

Share this post


Link to post
Share on other sites

Noone can help me?

Share this post


Link to post
Share on other sites

I updated to the latest beta.

Same output:

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType

--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidObjectType

Share this post


Link to post
Share on other sites

Thanks, now it works.

It was not working because I didn't run it with the beta compiler.

Share this post


Link to post
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
Sign in to follow this  
Followers 0