Jump to content

Recommended Posts

Posted

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
Posted

Moved to the appropriate forum.

Moderation Team

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:

  Reveal hidden contents

 

Posted (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 by 20Ice18

❤️

Posted
  On 6/15/2023 at 7:56 AM, 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)

Expand  

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:

  • 2 weeks later...
Posted
  On 6/15/2023 at 11:13 AM, 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

Expand  

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

Posted
  On 6/15/2023 at 6:16 PM, robertocm said:
Expand  

Thanks, not possible unfortunately as I cannot run an executable script or install autoit on the remote desktop unfortunately 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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