Current time: 09-20-2019, 12:40 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Authentication doesn't work with scripting
04-20-2015, 07:26 AM
Post: #1
Sad Authentication doesn't work with scripting
I need a help regarding authenticating users via login page.

I am trying to login user and then navigating to the my/account page where user can see his/her account information. Below are the steps I am following which are the same as I am browsing the site.

  1. navigate to the login screen
  2. Fill username and password
  3. Submit the login form
  4. navigate to my/account page

Below is the script I am using.

logData 0

// bring up the login screen
navigate https://www.chegg.com/auth?action=login

logData 1

// log in
setValue name=email someone@example.com
setValue name=password MY_PASSWORD
submitForm name=login-form

navigate https://www.chegg.com/my/account


Tab characters are there in the script but somehow they not appearing correctly. Also I am using a legit username/password that works on the site. The issue I am seeing is upon navigating user to my/account page somehow the authentication didn't happen on the first step so it will redirect user back to the login screen. The same username/password works when I try them on the actual site.

Any help is appreciated.
Find all posts by this user
Quote this message in a reply
04-21-2015, 06:51 PM
Post: #2
RE: Authentication doesn't work with scripting
I tend to use exec and execAndWait for login forms these days, so something like this should work bu I've not tested it:

Code:
logData    0

// bring up the login screen
navigate    https://www.chegg.com/auth?action=login

logData    1

// log in
exec document.getElementByName("email")[0].value = "someone@example.com"
exec document.getElementByName("password")[0].value = "password"
execAndWait document.getElementByName("login-form")[0].click()

navigate    https://www.chegg.com/my/account

Andy

Using WebPageTest - http://usingwpt.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
04-23-2015, 03:25 PM (This post was last modified: 04-23-2015 05:08 PM by bhargav2785.)
Post: #3
RE: Authentication doesn't work with scripting
(04-20-2015 07:26 AM)bhargav2785 Wrote:  I need a help regarding authenticating users via login page.

I am trying to login user and then navigating to the my/account page where user can see his/her account information. Below are the steps I am following which are the same as I am browsing the site.

  1. navigate to the login screen
  2. Fill username and password
  3. Submit the login form
  4. navigate to my/account page

Below is the script I am using.

logData 0

// bring up the login screen
navigate https://www.chegg.com/auth?action=login

logData 1

// log in
setValue name=email someone@example.com
setValue name=password MY_PASSWORD
submitForm name=login-form

navigate https://www.chegg.com/my/account


Tab characters are there in the script but somehow they not appearing correctly. Also I am using a legit username/password that works on the site. The issue I am seeing is upon navigating user to my/account page somehow the authentication didn't happen on the first step so it will redirect user back to the login screen. The same username/password works when I try them on the actual site.

Any help is appreciated.

Thanks Andy!

I tried that as well but no luck. I switched the site considering there is something wrong with the previous site but even with Twitter I am not able to login.

navigate https://twitter.com

ignoreErrors 1

exec document.getElementById('signin-email').value = 'username'
exec document.getElementById('signin-password).value = 'password'
execAndWait document.getElementsByClassName('submit')[0].click()

navigate https://twitter.com/settings/account


Is anyone else faced this issue? What am I doing wrong?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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