Jump to content

Passing variable(s) from GUI form to Website


Recommended Posts

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.

#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
Link to comment
Share on other sites

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

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • Moderators

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
Typo

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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