Jump to content

"_IEFormElementSetValue($o_login" <---Entering userinput.


Recommended Posts

Hello,

Sorry for double post but this is just a quick one,

In my script iam starting to use _IE functions as it makes it all alot crisp/better looking than controlclick,

I have one problem though how can i use "Input" in a _IEFormElementSetValue function?

Example:

This is the Userinput function

func num()
$happy = GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45)
$file = GUICtrlCreateInput("", 10, 5, 300, 20)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
$btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20)
GUISetState()
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $Btn
$temp = GUICtrlRead($file)
guidelete($happy)
go()
EndSelect
WEnd
endfunc

It creates a box i put in anything and presumbably it saves that string to $temp

I now want to put this string i wrote into an element,

Example:

func go()
$oIE = _IECreate()
_IENavigate($oIE, "[url="https://apply.eidverifier.net/uru/connect/login/login.faces"]https://apply.eidverifier.net/uru/connect/login/login.faces[/url]")
; get pointers to the login form and username and password fields
$o_form = _IEFormGetObjByName($oIE, "LoginloginForm")
$o_login = _IEFormElementGetObjByName($o_form, "$temp")
$o_password = _IEFormElementGetObjByName($o_form, "password")
_IEFormElementSetValue($o_login, "Ant") ;This is where iam trying to put the userinput
;I have also tried the following
_IEFormElementSetValue($o_login, "$temp")
_IEFormElementSetValue($o_login, $temp)
_IEFormElementSetValue($o_login, GUICtrlRead($file))

I know im probably doing something wrong,

Help is apreciated, Full script is under

#include <IE.au3>
#include <GUIConstants.au3>
num()
; Create a browser window and navigate to hotmail
func go()
$oIE = _IECreate()
_IENavigate($oIE, "[url="https://apply.eidverifier.net/uru/connect/login/login.faces"]https://apply.eidverifier.net/uru/connect/login/login.faces[/url]")
; get pointers to the login form and username and password fields
$o_form = _IEFormGetObjByName($oIE, "LoginloginForm")
$o_login = _IEFormElementGetObjByName($o_form, "$temp")
$o_password = _IEFormElementGetObjByName($o_form, "password")
_IEFormElementSetValue($o_login, "Ant") ;This is where iam trying to put the userinput
_IEFormElementSetValue($o_password, "pass")
_IELoadWait($oIE)
$oButton=_IEGetObjById($oIE,"login")
_IEAction ($oButton, "click")
_IELoadWait($oIE,0)
$oButton2=_IEGetObjById($oIE,"menu:menu_WorkBench")
_IEAction ($oButton2, "click")
_IELoadWait($oIE, 0)
$oButton3=_IEGetObjById($oIE,"sideMenu:menu_roleAdminMenuPage")
_IEAction ($oButton3, "click")
_IELoadWait($oIE, 0)
endfunc
func num()
$happy = GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45)
$file = GUICtrlCreateInput("", 10, 5, 300, 20)
GUICtrlSetState(-1, $GUI_ACCEPTFILES)
$btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20)
GUISetState()
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $Btn
$temp = GUICtrlRead($file)
guidelete($happy)
go()
EndSelect
WEnd
endfunc

Exit
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...