JemO Posted June 15, 2023 Posted June 15, 2023 I have created a script to automate data entry to a website from an excel record Can I return the ID/name of a form input text field form on a website over a RDS (the autoit script is running on my computer not the remote computer) To give context, currently it starts by clicking at the first input field then tabbing through while inputting data in each field then sending an "enter" to save the form and waiting a set amount of time while it process it. (The form is a javascript form on the website and it saves and reloads without actually reloading the webpage itself) once this time has passed the script again sends a mouseclick and restarts the process until all the data is entered from the excel file.
Moderators Melba23 Posted June 15, 2023 Moderators Posted June 15, 2023 Moved to the appropriate forum. 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
20Ice18 Posted June 15, 2023 Posted June 15, 2023 (edited) It should be possible to retrieve the ID or name of a form input text field on a website using AutoIt, even if script is running on your local computer and not on the remote computer. To retrieve the ID or name of a form input text field, you can use the AutoIt function _IEGetObjById or _IEGetObjByName These functions are used to retrieve a reference to an element on a webpage based on its ID or name, respectively. example: #include <IE.au3> ; Open the webpage Local $oIE = _IECreate("http://example.com") ; Retrieve the form input field by ID Local $oInputFieldById = _IEGetObjById($oIE, "input_field_id") Local $sInputFieldId = $oInputFieldById.id ; Retrieve the form input field by name Local $oInputFieldByName = _IEGetObjByName($oIE, "input_field_name") Local $sInputFieldName = $oInputFieldByName.name ; Output the retrieved IDs/names ConsoleWrite("Input field ID: " & $sInputFieldId & @CRLF) ConsoleWrite("Input field name: " & $sInputFieldName & @CRLF) ; Cleanup _IEQuit($oIE) I'm not sure if this is what you meant but In the example above, replace "http://example.com" with the actual URL of the website you're working with. "input_field_id" and "input_field_name" should be replaced with the appropriate IDs or names of the form input fields you want to retrieve. Once you have the ID or name of the form input field, you can use AutoIt functions like _IEFormElementSetValue or _IEAction to interact with and populate the fields with data from your Excel file please let me know if it helped Edited June 15, 2023 by 20Ice18 ❤️
robertocm Posted June 15, 2023 Posted June 15, 2023 10 hours ago, JemO said: Can I return the ID/name of a form input text field form on a website over a RDS (the autoit script is running on my computer not the remote computer) You should run a compiled script on the remote server, from your computer you only see a kind of "video" of the remote screen, not possible direct interaction with controls. I have some examples: https://www.autoitscript.com/forum/topic/200843-executing-a-script-on-a-remote-machine/?do=findComment&comment=1441237 https://www.autoitscript.com/forum/topic/205023-how-do-i-go-about-making-a-program-that-look-on-the-screen-for-on-image-and-then-click-on-it/?do=findComment&comment=1474031 https://www.autoitscript.com/forum/topic/203441-rdp-interaction-moved/?do=findComment&comment=1461206
JemO Posted June 24, 2023 Author Posted June 24, 2023 On 6/15/2023 at 11:13 PM, 20Ice18 said: It should be possible to retrieve the ID or name of a form input text field on a website using AutoIt, even if script is running on your local computer and not on the remote computer. To retrieve the ID or name of a form input text field, you can use the AutoIt function _IEGetObjById or _IEGetObjByName These functions are used to retrieve a reference to an element on a webpage based on its ID or name, respectively. example: #include <IE.au3> ; Open the webpage Local $oIE = _IECreate("http://example.com") ; Retrieve the form input field by ID Local $oInputFieldById = _IEGetObjById($oIE, "input_field_id") Local $sInputFieldId = $oInputFieldById.id ; Retrieve the form input field by name Local $oInputFieldByName = _IEGetObjByName($oIE, "input_field_name") Local $sInputFieldName = $oInputFieldByName.name ; Output the retrieved IDs/names ConsoleWrite("Input field ID: " & $sInputFieldId & @CRLF) ConsoleWrite("Input field name: " & $sInputFieldName & @CRLF) ; Cleanup _IEQuit($oIE) I'm not sure if this is what you meant but In the example above, replace "http://example.com" with the actual URL of the website you're working with. "input_field_id" and "input_field_name" should be replaced with the appropriate IDs or names of the form input fields you want to retrieve. Once you have the ID or name of the form input field, you can use AutoIt functions like _IEFormElementSetValue or _IEAction to interact with and populate the fields with data from your Excel file please let me know if it helped Thanks but I was wanting to run the script on the local computer but for it to enter it on the remote desktop. Because the remote desktop is a server and I don't have administration access I cannot install autoit or run an executable script on the remote desktop Hope that makes sense
JemO Posted June 24, 2023 Author Posted June 24, 2023 On 6/16/2023 at 6:16 AM, robertocm said: You should run a compiled script on the remote server, from your computer you only see a kind of "video" of the remote screen, not possible direct interaction with controls. I have some examples: https://www.autoitscript.com/forum/topic/200843-executing-a-script-on-a-remote-machine/?do=findComment&comment=1441237 https://www.autoitscript.com/forum/topic/205023-how-do-i-go-about-making-a-program-that-look-on-the-screen-for-on-image-and-then-click-on-it/?do=findComment&comment=1474031 https://www.autoitscript.com/forum/topic/203441-rdp-interaction-moved/?do=findComment&comment=1461206 Thanks, not possible unfortunately as I cannot run an executable script or install autoit on the remote desktop unfortunately
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