Jump to content



Photo

Passing variable(s) from GUI form to Website


  • This topic is locked This topic is locked
2 replies to this topic

#1 fleone

fleone

    Seeker

  • Active Members
  • 5 posts

Posted 16 May 2012 - 05:44 PM

Our group has been using an exe file created with AutoIT as a tool for grading student assignments in a proprietary 3rd party application. This executable file would take YOUR username and password and pass it along to the internal website that hosted the SSO login page. The application has received an update and now longer provides the grading functionality that we need. The person that created the script and subsequent executable file is regrettably no longer with our company and did not see fit to leave the source code for the script. It has fallen to me to try to create a new executable file that will overcome the changes made in our 3rd party application. I have pretty much figured out the navigation of the web pages, and the links, but what I have not been able to figure out is how to get a username and password from the GUI into the fields on the login page. I can do it easily by putting my username and password in the script file, but then I would need to have the other members of my team do the same thing, and since these usernames and passwords are active directory in nature, leaving them in plain text in a script is not the best course of action.
  • Does it violate the rules of the forum to ask for assistance with this? It is a login, but I don’t think it meets the “SPAM tools including instant messenger or forum auto-posters. This includes forum or site auto-login methods.” criteria, as it requires the user to enter their credentials each time they launch the application.
  • I believe that it has something to do with capturing the username and password that are entered in the GUI form and saving them as variables to pass on to the website.
  • If this does not violate the forum rules, can someone please point me in the appropriate direction?
I have viewed dozens of how-to AutoIT videos…some good, some not so good, and really didn’t find an answer there.

If this request does in fact violate the forum rules for posting. I sincerely apologize.

Thanks!

Here is the code for the input box:
The usenam field should pass information on to the "UserName" field on the website
The passwrd field should pass information on to the "txtPassword" field on the website.

AutoIt         
#include <IE.au3>           #include <ButtonConstants.au3>           #include <EditConstants.au3>           #include <GUIConstantsEx.au3>           #include <StaticConstants.au3>           #include <WindowsConstants.au3>           #Region ### START Koda GUI section ### Form=           $Login = GUICreate("Login", 286, 114, 327, 207)           GUISetBkColor(0xA6CAF0)           $Username = GUICtrlCreateLabel("Username", 5, 9, 59, 19)           $Password = GUICtrlCreateLabel("Password", 5, 33, 58, 19)           GUICtrlSetFont(-1, 10, 400, 0, "Calibri")           $usernam = GUICtrlCreateInput("", 72, 8, 193, 21)           $passwor = GUICtrlCreateInput("", 72, 32, 193, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))           $Continue = GUICtrlCreateButton("Continue", 56, 64, 175, 33)           GUICtrlSetFont(-1, 10, 400, 0, "Calibri")           GUISetState(@SW_SHOW)           #EndRegion ### END Koda GUI section ###           While 1           $nMsg = GUIGetMsg()           Switch $nMsg           Case $GUI_EVENT_CLOSE           Exit           EndSwitch           Wend






#2 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,834 posts

Posted 16 May 2012 - 06:30 PM

Heres a pointer

Local $UN While 1     $nMsg = GUIGetMsg()     Switch $nMsg        Case $GUI_EVENT_CLOSE            Exit        Case $Continue            $UN = GUICtrlRead($usernam)            MsgBox(0,0,$UN)            Exit     EndSwitch Wend

Edited by JohnOne, 16 May 2012 - 06:31 PM.

AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)

#3 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,330 posts

Posted 16 May 2012 - 06:54 PM

fleone,

Does it violate the rules of the forum to ask for assistance with this?

Unfortunately it does because it has to do with:

capturing the username and password that are entered in the GUI form and saving them as variables to pass on to the website

and so I am going to lock this thread. ;)

M23

Edited by Melba23, 16 May 2012 - 08:26 PM.
Typo

StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users