AfsarP1 Posted June 3, 2020 Share Posted June 3, 2020 Hi Team I'm new to AutoIt, I've been looking at videos and articles to understand AutoIt and automating a every-day work process. Below is what i'm trying to achieve. 1. Open a Citrix URL 2. Enter the username and password 3. Login I'm able to do this successfully by hard coding the values(URL, Username and Password). What I want to achieve is to create an executable file which does this job for different users and obviously each user will have their own credentials. How do I make this dynamic. Meaning allowing user's to enter their own credentials. In some cases, the url will also change for some users. How can I make this as well dynamic. Someone suggested me to use CMD but i'm having a real trouble using it. Would someone be able to guide me here? Here is the code i've built: #include <IE.au3> $Url = "https://testurl.com" $Username = 'testusername' ;This should be replaced with End user's username $Password = "testpassword" ;This should be replaced with End user's password $CmdLine[0] = $Url ; NOT SURE HOW THIS WORKS, WAS TRYING DIFFERENT THINGS. $CmdLine[0] = $Username ; NOT SURE HOW THIS WORKS, WAS TRYING DIFFERENT THINGS. $CmdLine[0] = $Password ; NOT SURE HOW THIS WORKS, WAS TRYING DIFFERENT THINGS. Global $oIE = _IECreate($Url, 1, 1, 0, 1) ;Open the URL with specified conditions WinActivate("NetScaler Gateway") ;Activate the Window with the string "Netscaler Gateway" on the top left WinWait("NetScaler Gateway") ;This will wait for the "Netscaler window" to be come alive Sleep(10000) ;Sleeping as the time taken to load the CTX URL is long WinWaitActive("NetScaler Gateway") ; This will wait for the "Netscaler Gateway" window to be activated to enter credentials as users might shift focus to different tasks while the page is loading. Send($Username) Sleep(1000) Send("{TAB}") Send($Password) Sleep(1000) Send("{TAB}") Send("{ENTER}") Appreciate your comments/suggestions. Thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 3, 2020 Moderators Share Posted June 3, 2020 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
AfsarP1 Posted June 5, 2020 Author Share Posted June 5, 2020 I wasn't aware of that. Thanks for moving it to the right page. Link to comment Share on other sites More sharing options...
Subz Posted June 6, 2020 Share Posted June 6, 2020 Why don't you enable "AlwaysOn" on the NetScaler Appliance or single sign-on? Passing username/password would be a major security risk to your companies network. Trying to make the script dynamic would also require the password being stored externally which is an additional risk. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now