Using auto fill on uniquely generated form field ID's

Using auto fill on uniquely generated form field ID's

avatar

For security reasons a specific website generates unique Username and Password field ID's.

For example:
Username ID = D3QOGtUwQvywe7oRginputUserID
Password ID = D3QOGtUwQvywe7oRginputPassword


while the next it loads the ID's are:
Username ID = I8d7hR5AdX8C0lihinputUserID
Password ID = I8d7hR5AdX8C0lihinputPassword


As you can see they all have two things in common. First, they all end with inputUserID or inputPassword and both fieds start with the same unique code.
RDM discovers the form as it should.


Is there any way to make autofill work on these kinds of forms. By using wildcards in the Field ID for example?

All Comments (7)

avatar

Hi,

Do you know if the fields also have a name property?

Do they change too?

Best regards,

Olivier Désalliers

avatar

Hi Olivier,


Thanks for your response. The name are identical as the ID's and do change too. Only the Class seems to be consistent.


Regards,


Jasper

avatar

Hi,

If you are using Chrome embedded, it's possible to create a custom JavaScript script where you could get the fields and fill them using the RDM variables in the script ($USERNAME$ and $PASSWORD$).

This window is available in the Login tab -> Html Control ID -> Custom Script.

If you need any help to make this script, we will be happy to help you. :)

Best regards,

Olivier Désalliers

avatar

Hi Olivier,


Great hunch. I'm almost there but still need some support. Below my Javascript code for testing purposes. When I copy the complete source into a local HTML file and add this code, it all works fine. When I open the page from within RDM nothing happens.


























avatar

Hi,

I modified and tried the script I have wrote below on another website (with of course different ids and class names) and it worked.

I removed the script tags, modified the for loop, changed the equality (==) for identity/strict equality (===) and I use the element when the class name is matching.

[color=#494949][i]var elements = document.getElementById("signInForm").elements;[/i][/color]
[color=#494949][i]for (var j = 0; j < elements.length; j++) {[/i][/color]
[color=#494949][i] var element = [/i][/color][i]elements[j];[/i]
[color=#494949][i] if (element.className === "inputTypeLogin") {[/i][/color]
[color=#494949][i] element.value = "$USERNAME$"[/i][/color]
[color=#494949][i] }[/i][/color]
[color=#494949][i] if (element.className === "inputTypePassword") {[/i][/color]
[color=#494949][i] element.value = "$PASSWORD$"[/i][/color]
[color=#494949][i] }[/i][/color]
[color=#494949][i]}[/i][/color]
Let me know if there are any problems.

Best regards,

Olivier Désalliers

avatar

Olivier,
Great work!
Just to complete your answer. Don't forget to check "Allow password in variable" on the Security Page of the entry.

avatar

Hi,

You're right, thanks for completing my answer.

Good to know that it works! :)

Best regards,

Olivier Désalliers

Ends in 4 days