0

I'm trying to create an autologin script for https://sso.verisk.com/login/default

I'm able to load the page and populate the Username and Password fields, but after clicking the Sign In button it will say "Please enter a username" and "Please enter a password". If I simply delete a character from the populated field, it will pass the validation.

To narrow it down, I've visited the page at https://sso.verisk.com/login/default and used the console to enter:

document.getElementById("okta-signin-username").value = "username"
document.getElementById("okta-signin-password").value = "password"
document.getElementById("okta-signin-submit").click()

As mentioned, this populates the Username and Password, but the validation doesn't detect field values until a character is either deleted or added manually. I've tested forms on other web sites with success so I'm not sure why this one is failing. Would greatly appreciate any points in the right direction!!

Jason
  • 21
  • 3
  • How does the provided code implement a form validation? Please add the relevant code to the post instead of linking to your site. As it currently is, after you've fixed the issues, this question is totally useless for the future visitors. – Teemu Nov 15 '19 at 22:31
  • This is not my website. It is a third party website that I am trying to create a script for an auto-login shortcut. It has some sort of validation that is preventing my code above, which is why I am asking for help – Jason Nov 15 '19 at 22:33

1 Answers1

0

I believe the proper question could be "how can I submit a form programmatically"

The solution is this

enter image description here

Forms work like this, don't always think like a human when you deal with systems. The query selector is simply "form" because form is the only one form element in the entire document.