Current time: 12-16-2017, 12:12 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling JavaScript func
08-23-2017, 09:37 AM
Post: #1
Calling JavaScript func
Hi,

I can no longer using the following script to log into our site because we use JavaScript functions instead.

logData 0
setValue id=username user1
setValue id=password password
submitForm name=loginForm

How would I put the following line in wpt scripting?

document.getElementById("__input1-inner").value = "username";
document.getElementById("__input2-inner").value = "password";
document.getElementById("loginForm").submit();

Thanks,

-sam
Find all posts by this user
Quote this message in a reply
08-24-2017, 08:21 PM
Post: #2
RE: Calling JavaScript func
exec and execAndWait are what you're looking for

exec document.getElementById("__input1-inner").value = "username";
exec document.getElementById("__input2-inner").value = "password";
execAndWait document.getElementById("loginForm").submit();

As per slide 38 (last line) of https://docs.google.com/presentation/d/1...2107_0_124 I often grab the element for the submit button and send a click to it instead of using submit

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
08-31-2017, 03:46 AM
Post: #3
RE: Calling JavaScript func
Thank you Andy!

Really helpful. it works!

-sam
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)