-
Posts
19 -
Joined
-
Last visited
Recent Profile Visitors
121 profile views
kkelley's Achievements
-
So for reference $serverCombo and $userCombo do have items in there, removed for privacy
-
The code is over 2000 lines but I will include a short version you can look at and maybe we can get somewhere. #include "Login.au3" ;===============================================================================================================================================================================================================================; ;Creating GUI $hGUI = GUICreate("UAT", 450, 270, 350, 150) $browserCombo = GUICtrlCreateCombo("", 72, 58, 313, 25) $serverCombo = GUICtrlCreateCombo("", 72, 118, 313, 25) $userCombo = GUICtrlCreateCombo("", 72, 178, 313, 25) $userLbl = GUICtrlCreateLabel("Select User Name", 72, 148, 250, 23) GUICtrlSetFont(-1, 12, 800, 0, "Rockwell") $browserLbl = GUICtrlCreateLabel("Select Browser", 72, 28, 250, 23) GUICtrlSetFont(-1, 12, 800, 0, "Rockwell") $serverLbl = GUICtrlCreateLabel("Select Server", 72, 88, 250, 23) GUICtrlSetFont(-1, 12, 800, 0, "Rockwell") $startBtn = GUICtrlCreateButton("Start", 72, 220, 75, 25) GUICtrlSetFont(-1, 10, 800, 0, "Rockwell") $exitBtn = GUICtrlCreateButton("Exit", 312, 220, 75, 25) GUICtrlSetFont(-1, 10, 800, 0, "Rockwell") GUICtrlSetData($browserCombo, "Internet Explorer|Google Chrome|Mozilla Firefox", "Internet Explorer") GUICtrlSetData($serverCombo, "", " ") GUICtrlSetData($userCombo, "", " ") GUISetState(@SW_SHOW) ;===============================================================================================================================================================================================================================; StartGUI() Func StartGUI() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $exitBtn Exit Case $startBtn $browser = GUICtrlRead($browserCombo) $server = GUICtrlRead($serverCombo) $user = GUICtrlRead($userCombo) ExitLoop EndSwitch WEnd GUIDelete($hGUI) ;---------------------------UAT-------------------------------------; If $browser = "Internet Explorer" And $server = "UAT" Then _IEuat() ElseIf $browser = "Google Chrome" And $server = "UAT" Then _Chromeuat() ElseIf $browser = "Mozilla Firefox" And $server = "UAT" Then _FFuat() EndIf #include <GUIConstantsEx.au3> #include <Constants.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <GuiEdit.au3> #include <MsgBoxConstants.au3> ;---------------------------------------------------; ;Opens UAT in internet explorer Func _IEuat() ShellExecute($IElocation) Sleep(5000) Send("!d") Sleep(1000) Send($UATweb) Send("{Enter}") Sleep(1000) Send($userName) Send("{Tab}") Sleep(1000) Send($password) Sleep(1000) Send("{Enter}") Sleep(3000) MouseClick("Left", 960, 405) Sleep(5000) EndFunc ;Opens UAT in mozilla firefox Func _FFuat() ShellExecute($FFlocation) Sleep(5000) Send("!d") Sleep(1000) Send($UATweb) Send("{Enter}") Sleep(1000) Send($userName) Sleep(1000) Send("{Tab}") Sleep(1000) Send($password) Send("{Enter}") Sleep(3000) MouseClick("Left", 954, 381) Sleep(5000) EndFunc ;Opens UAT in google chrome Func _Chromeuat() ShellExecute($Chromelocation) Sleep(5000) Send("!d") Sleep(1000) Send($UATweb) Send("{Enter}") Sleep(1000) Send($userName) Sleep(1000) Send("{Tab}") Sleep(1000) Send($password) Send("{Enter}") Sleep(3000) MouseClick("Left", 960, 405) Sleep(5000) EndFunc
-
I am currently having a problem with creating a more dynamic style of GUI. I have two items in a ComboBox if selected I want to turn the other ComboBox off, or display *Not Needed*. I only know how to put this logic into the button click that I have. Is there some way to do a $GUI_HIDE or something? thanks for your help.
-
It was giving me the error on the $browser on the dollar sign, instead of on the && operator. Thanks for the help!
-
kkelley reacted to a post in a topic: Problems with an If statement
-
kkelley reacted to a post in a topic: Problems with an If statement
-
If $browser = "Internet Explorer" && $server = "DEV '.33'" Then _IEDEV() will the && operation work? I am trying to get this to look at two separate combo-boxes and using the data to run the function.
-
Melba, what would be your recommendation to do a selected button?
-
I have another question, if I had 4 buttons and when I clicked on one the color would change, but if I clicked on another; the first button that I clicked on would revert back to default. How would I do something like that.
-
That works great! thanks JLogan3o13, I would include the rest of the code but it is quite a large number of files.
-
Hello! I am making a GUI on autoit, I would like the button to change color when selected from default to red. I have searched the forums and haven't really found what I am looking for. Any suggestions would be appreciated. Here is my code thus far. #include "utils.au3" ;Setting Constants Global $screenHeight=@DesktopHeight Global $screenWidth=@DesktopWidth Global $expectedScore=0 Global $errors=0 Global $type Global $user Global $pwd Global $program Global $exam Global $platform Global $passScore Global $activity ;Can/Will Change these values later Global $wordRecognitionIntensity=99 Global $tutorialquestions=4 Global $actualquestions=50 Global $SecondsUntilQuestionTimesOut=20 Global $gridSearchIntensity=30 Global $topScreenCutOff=1 Local $failedQuestions="" ;Starts GUI that asks for login information, exam to take, etc.. $allowInput= True StartGUI() $allowInput= False Func StartGUI() ;========================GUI Items=========================; $hGUI = GUICreate("Auto Tester", 601, 436, 433, 170) GUISetBkColor(0xFFFFFF) $certiportLogo = GUICtrlCreatePic("C:\Users\UKELLKI\Dropbox\AutoIt\Images\certiport.jpg", 0, 0, 600, 75, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $portalButton = GUICtrlCreateButton("Portal", 24, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($portalButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $lmsButton = GUICtrlCreateButton("LMS", 168, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($lmsButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $consoleButton = GUICtrlCreateButton("Console", 312, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($consoleButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $launcherButton = GUICtrlCreateButton("Exam Launcher", 456, 120, 115, 25, $WS_GROUP) GUICtrlSetFont(-1, 10, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($launcherButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x808080) $serviceLabel = GUICtrlCreateLabel("Select Service", 376, 64, 152, 29) GUICtrlSetFont(-1, 16, 800, 0, "Georgia") $exitButton = GUICtrlCreateButton("Exit", 456, 376, 115, 30, $WS_GROUP) GUICtrlSetFont(-1, 14, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($exitButton, 0xfffafa) GUICtrlSetBkColor(-1, 0x000000) ;=======================Hidden Items=======================; $userLabel = GUICtrlCreateLabel("User Name", 376, 192, 94, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $passwordLabel = GUICtrlCreateLabel("Password", 376, 264, 83, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $iuser = GUICtrlCreateInput("", 376, 232, 193, 21) $ipassword = GUICtrlCreateInput("123456", 376, 304, 193, 21, 0x0020) $runLabel = GUICtrlCreateLabel("Run On", 24, 168, 66, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $programLabel = GUICtrlCreateLabel("Program", 24, 232, 76, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $courseLabel = GUICtrlCreateLabel("Course ID", 24, 232, 100, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $courseInput = GUICtrlCreateInput("", 24, 264, 257, 25) $scoringLabel = GUICtrlCreateLabel("Scoring Pass", 24, 296, 108, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $typeSelect = GUICtrlCreateCombo("", 24, 200, 257, 25) GUICtrlSetData($typeSelect, "Staging|Test|Prod", "Staging") $programSelect = GUICtrlCreateCombo("", 24, 264, 257, 25) GUICtrlSetData($programSelect, "Internet and Computing Core Certification|Adobe Certified Associate|Autodesk Certified User|Certiport Training|CompTIA Strata|HP Accredited Technical Associate|Intuit QuickBooks|Microsoft Certified Educator|Microsoft Office Specialist|Microsoft Technology Associate", "Internet and Computing Core Certification") $scoreSelect = GUICtrlCreateCombo("", 24, 328, 257, 25) GUICtrlSetData($scoreSelect, "Smoke Test|1000 Pass|Barely Pass|Barely Fail", "Smoke Test") $iContinue = GUICtrlCreateButton("Continue", 24, 376, 115, 30, $WS_GROUP) GUICtrlSetFont(-1, 14, 400, 0, "Georgia") GUICtrlSetCursor (-1, 0) GUICtrlSetColor($iContinue, 0xfffafa) GUICtrlSetBkColor(-1, 0x000000) $browserLabel = GUICtrlCreateLabel("Select Browser", 24, 168, 125, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $browserCombo = GUICtrlCreateCombo("", 24, 200, 257, 25) GUICtrlSetData($browserCombo, "Internet Explorer|Mozilla Firefox|Google Chrome|Safari", "Internet Explorer") $activityLabel = GUICtrlCreateLabel("Select Activity", 24, 168, 126, 22) GUICtrlSetFont(-1, 12, 800, 0, "Georgia") $activityCombo = GUICtrlCreateCombo("", 24, 200, 257, 25) GUICtrlSetData($activityCombo, "Study|Practice|Certify", "Study") ;=======================Hiding Items=======================; GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;================End of GUI Items/Hidden Items================; GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $exitButton Exit Case $portalButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetData($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($programLabel, $GUI_SHOW) GUICtrlSetState($programSelect, $GUI_SHOW) GUICtrlSetState($runLabel, $GUI_SHOW) GUICtrlSetState($typeSelect, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) Case $lmsButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetState($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($browserLabel, $GUI_SHOW) GUICtrlSetState($browserCombo, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) Case $consoleButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetState($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($activityLabel, $GUI_SHOW) GUICtrlSetState($activityCombo, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) Case $launcherButton ;This ensures that the fields change when clicking different browser service GUICtrlSetState($userLabel, $GUI_HIDE) GUICtrlSetState($passwordLabel, $GUI_HIDE) GUICtrlSetState($iuser, $GUI_HIDE) GUICtrlSetState($ipassword, $GUI_HIDE) GUICtrlSetState($runLabel, $GUI_HIDE) GUICtrlSetState($programLabel, $GUI_HIDE) GUICtrlSetState($scoringLabel, $GUI_HIDE) GUICtrlSetState($typeSelect, $GUI_HIDE) GUICtrlSetState($programSelect, $GUI_HIDE) GUICtrlSetState($scoreSelect, $GUI_HIDE) GUICtrlSetState($iContinue, $GUI_HIDE) GUICtrlSetState($browserLabel, $GUI_HIDE) GUICtrlSetState($browserCombo, $GUI_HIDE) GUICtrlSetState($activityLabel, $GUI_HIDE) GUICtrlSetState($activityCombo, $GUI_HIDE) GUICtrlSetState($courseLabel, $GUI_HIDE) GUICtrlSetState($courseInput, $GUI_HIDE) ;Clearing the data in the user and password fields GUICtrlSetState($iuser, "") ;Clears password data, automatically set to 123456 *will need to be changed!* ;GUICtrlSetState($ipassword, ""); will need to decomment when launched ;End Reset Function GUICtrlSetState($userLabel, $GUI_SHOW) GUICtrlSetState($passwordLabel, $GUI_SHOW) GUICtrlSetState($iuser, $GUI_SHOW) GUICtrlSetState($ipassword, $GUI_SHOW) GUICtrlSetState($scoringLabel, $GUI_SHOW) GUICtrlSetState($scoreSelect, $GUI_SHOW) GUICtrlSetState($iContinue, $GUI_SHOW) GUICtrlSetState($browserLabel, $GUI_SHOW) GUICtrlSetState($browserCombo, $GUI_SHOW) GUICtrlSetState($courseLabel, $GUI_SHOW) GUICtrlSetState($courseInput, $GUI_SHOW) Case $iContinue ;Makes all of the information from GUI available $type=GUICtrlRead($typeSelect) $user=GUICtrlRead($iuser) $pwd=GUICtrlRead($ipassword) $program=GUICtrlRead($programSelect) $passScore=GUICtrlRead($scoreSelect) $activity=GUICtrlRead($activityCombo) $exam="selectLater" ExitLoop EndSwitch WEnd GUIDelete($hGUI) ;delete the file so it can be rewritten and set error log to 0 FileDelete ( "result.log.txt" ) DirRemove ("C:\TEMP",1) DirCreate ("C:\TEMP") _BlockInputEx(1, "{Pause}") if $program="Adobe Certified Associate" then $topScreenCutOff=5 endif ;loads the test up from the correct platform and browser if $platform="Portal Internet Explorer" then _callIE() ElseIf $platform="Portal Chrome" then _PortalBrowser("chrome.exe") ElseIf $platform="Portal Firefox" then _PortalBrowser("firefox.exe") ElseIf $platform="Portal Safari" Then _PortalBrowser("safari.exe") ElseIf $platform="Console" then _CallConsole() EndIf LockdownNav() EndFunc
-
EzSkin_1-2-3 (exe) 1,000+ Skin & Button Choices
kkelley replied to Valuater's topic in AutoIt Example Scripts
This is a great tool! thanks -
Thanks all for your posts to this question. I am trying to use the IniWrite and IniRead functions, but I am a little confused on how I could get them to work with my GUI. Does anyone have an example of this? my attempts at searching the forums have been uneventful.
-
I currently am developing a little GUI to run some software automation. In this GUI a user will add a username into a GUICtrlCreateInput. I always want this to be blank to start with but I want it to remember the usernames that have been used previously. I would like to click on a drop down arrow and have the past three or so viewable. Is this possible?
-
Noted! I will look into it further.
-
Thanks again JLogan3013! That made for a nice GUI.
-
kkelley reacted to a post in a topic: GUI dynamics
-
kkelley reacted to a post in a topic: GUI dynamics
-
kkelley reacted to a post in a topic: GUI dynamics
-
Thanks JLogan3o13, and Melba23! While I have your attention, I am curious how to get them to switch now? So for instance if I click on one button it has a few options like a combo box and a user input, when I click on another it doesn't switch the views it just keeps what it was before. What would be a way to debug that?