Forum Discussion

ndobrez's avatar
ndobrez
New Contributor
12 years ago

Unable to Log in to Web Application

When I run a recorded test on my web app, the script is unable to get past the login credentials screen. It shows I have invalid username/password.



However, when I enter them in manually I'm able to login. 



Any ideas?





5 Replies

  • chrisb's avatar
    chrisb
    Regular Contributor
    Ok, so the username looks correct. Modify your test to it writes the password to the username field and see what it outputs. Take a look to see if it appends it with some whitespace. I've been caught out before by strings in a test that had one leading or trailing blank character.



    Also try debugging your test and see what the username and password variables are actually set to during runtime. You could also try modifying the test to login to say something like an email account. Assuming that works then you can be sure the interaction between your script and that specific page is the issue.



    If you are scripting what method are you using for the text entry? SetText or Keys?
  • chrisb's avatar
    chrisb
    Regular Contributor
    Take a look at the username and password fields using the Object Spy tool in Test Complete IDE. Look in the 'methods' panel and see if SetText and Keys are listed (under 'Actions') as supported methods on your controls. Then, go to your test script and change the SetText method to the Keys method and try again. If you are testing a web app try running the script in another browser assuming your application has cross browser support. Also try clearing your browser cache, could be something simple like the browser has the wrong login credentials cached and it is doing auto complete on the fields for you.
  • chrisb's avatar
    chrisb
    Regular Contributor
    You have verified the credentials you use in the test are correct, right? Are the login credentials getting malformed in some way? is the case changing, is whitespace appended to the username or password? Whitespace has cause me issues in the past in tests and I've sometimes had to trim the whitespace from a string before entering it in an application. Have you tried putting a breakpoint in your test and looking at the username and password variables during the test?
  • ndobrez's avatar
    ndobrez
    New Contributor
    So the user name is correct when its being entered, and the length of the password is correct in the password box. In the test suite, it shows the password as being correct. 



    -When I manually only re-enter the password and sign in it doesnt work. 

    -When I manually only re-enter the user name and sign in it doesnt work.

    -When I manually re-enter both, it signs in.



    Could there be a security feature on the page that doesn't allow automated scripts to sign in?
  • ndobrez's avatar
    ndobrez
    New Contributor


    -There are no blank characters being added.

    -So this works when logging into another application. 



    -I converted it to script and it says its using SetText.



    It may be application specific, just didn't know if that was a thing!



    I appreciate you taking the time to help. Thanks!