How to pass username and Password to a Table. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
MMuthu
Posts: 14
Joined: 03 May 2020, 12:20

How to pass username and Password to a Table.

22 Sep 2021, 05:08

Hi All,
I have used the attached OpenPPM.ahk and it worked fine.

Now the login page changed, It was changed to a Table. See the jsp debugger output new_site.txt

Now there is no elementId here, so how can I pass the username and Password to this table. Can anyone provide a sample?

Regards,
Mahesh RK.
Attachments
OpenPPM.ahk
(783 Bytes) Downloaded 32 times
new_site.txt
(2.01 KiB) Downloaded 32 times
User avatar
mikeyww
Posts: 26588
Joined: 09 Sep 2014, 18:38

Re: How to pass username and Password to a Table.

22 Sep 2021, 20:35

I don't know much about this, but the following seemed to meet your description.

Code: Select all

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := True
wb.Navigate("new_site.html")
wb.document.getElementById("username").value := "Test1"
wb.document.getElementById("password").value := "Test2"
MMuthu
Posts: 14
Joined: 03 May 2020, 12:20

Re: How to pass username and Password to a Table.

23 Sep 2021, 02:30

Hi Mikey,
Thank you for your response, but when I see the source of the new page

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<form action="/idp/Authn/UserPassword" method="post">

<table>
<tr><td width="40%"><label for="username">Username:</label></td><td><input name="j_username" type="text" id="username" autocapitalize="off" /></td></tr>
<tr><td><label for="password">Password:</label></td><td><input name="j_password" type="password" id="password" /></td></tr>
<tr><td></td><td><button type="submit" value="Login" >Continue</button></td></tr>
</table></form>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

There is no getElementById in the new site.

I am getting the below error.
image.png
image.png (12.92 KiB) Viewed 918 times
MMuthu
Posts: 14
Joined: 03 May 2020, 12:20

Re: How to pass username and Password to a Table.

23 Sep 2021, 03:48

I created a new .ahk file and pasted your command. Ran the script, but the username and password are not passed.

You can change the file location and try.
image.png
image.png (61.58 KiB) Viewed 905 times
image.png
image.png (30.99 KiB) Viewed 905 times
@teadrinker, Do you have any inputs?
Attachments
new_site.zip
(1.44 KiB) Downloaded 14 times
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: How to pass username and Password to a Table.

23 Sep 2021, 08:49

For me this works:

Code: Select all

wb.document.getElementById("username").value := "MyName"
wb.document.getElementById("password").value := "MyPass"
MMuthu
Posts: 14
Joined: 03 May 2020, 12:20

Re: How to pass username and Password to a Table.

24 Sep 2021, 08:21

teadrinker wrote:
23 Sep 2021, 08:49
For me this works:

Code: Select all

wb.document.getElementById("username").value := "MyName"
wb.document.getElementById("password").value := "MyPass"
Hi teadrinker,
Please see the attached recording? When I run the test.ahk, the page opens but it does not pass the username or password.

I have attached test.ahk and the new_site.html page as well.
Thank you.

Regards,
Mahesh. RK
Attachments
Testing.zip
(722.79 KiB) Downloaded 19 times
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: How to pass username and Password to a Table.

24 Sep 2021, 11:53

For me this code works as it is:
 
 Image
 
Perhaps, something wrong with your IE settings, try resetting settings to default.
Last edited by teadrinker on 24 Sep 2021, 14:48, edited 1 time in total.
User avatar
tank
Posts: 3122
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: How to pass username and Password to a Table.

24 Sep 2021, 12:02

why are neither of you testing that the page is loaded n document object exists
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: How to pass username and Password to a Table.

24 Sep 2021, 12:13

@tank
You are right, but in the previous version of the code there was

Code: Select all

while wb.busy
   sleep 100
@MMuthu, try

Code: Select all

...
wb.Navigate("file:///C:/Testing/new_site.html")
while wb.Busy || wb.ReadyState != 4
   Sleep, 100
...
MMuthu
Posts: 14
Joined: 03 May 2020, 12:20

Re: How to pass username and Password to a Table.

27 Sep 2021, 07:03

Hi Teadrinker,
Sorry to bug you.

I have reset IE. Please see the attached recording.

"while wb.Busy || wb.ReadyState != 4" had issues, so I used "while wb.busy".

Still I cannot make the username and Password auto-filled.

Are you opening the HTML file I provided? Can you provide the .ahk file you are using.
Not sure where I am making the mistake.
Thanks in advance.

Regards,
Mahesh RK.
Attachments
Testing.zip
(1.85 MiB) Downloaded 16 times
teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: How to pass username and Password to a Table.  Topic is solved

27 Sep 2021, 07:57

No idea what the issue is.
Attachments
Testing.zip
(184.99 KiB) Downloaded 27 times
MMuthu
Posts: 14
Joined: 03 May 2020, 12:20

Re: How to pass username and Password to a Table.

27 Sep 2021, 10:09

Hi teadrinker,
The issue seems to be very simple. When I run it as administrator, It runs successfully.
image.png
image.png (34.37 KiB) Viewed 652 times
So I provided the above grants to the compiled exe file.
Thanks for your kind help.

Regards,
Mahesh RK.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 125 guests