SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Nov 2000
    Location
    Ulm, DE
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to handle login on Web-Applications

    I need to test a web application. Before I can access to the mainpage of my app, I need to loggin. How to I automate the login process for automated testing.

    Do I have to use and Invoke Method + wStartup constant as for non Web aplication?

    How do I define a DefaultBaseState for automated testing do that Silk will automatically log the user in, get the the mainpage and run my testcases from there?

    thanks alot for your replies.

    ------------------
    Silverter - A profi was once a beginner
    Silverter - A guru was once a beginner

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Location
    Twin Cities, MN, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to handle login on Web-Applications

    Hi,

    If you record another Application State that involves the login process, then use that state for your testcase, you should be set.

    ------------------

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to handle login on Web-Applications

    Easiest way is forget about the BaseState.

    It doesn't make your life easier if you put your Login() in a different place, in this case BaseState().

    Basically you have to overwrite the function that Silk normally calls to run your extra codes. It's all in that help topic. You have to try it to see how it works. Personally I don't touch that.



    ------------------

  4. #4
    Member
    Join Date
    Aug 2000
    Location
    Hyderabad,AP,India
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to handle login on Web-Applications

    Hope I can help you...

    Look in the frame file your main page will be an BrowserChild eg..,

    [ ] window BrowserChild MyPage
    [ ] tag "My Page"
    // Just set the following...

    [ ] const sUserName = "baseer"
    [ ] const sPassword = "baseer"

    ---------------

    This will help you out if you add this line at the top of the file..

    const wMainWindow = MyPage


    ------------

    If you dynamically want to invoke the application...just load page as below...

    Browser.LoadPage ("www.mypage.com","baseer","baseer")

    Thanks
    Baseer

  5. #5
    Member
    Join Date
    Nov 2000
    Location
    Ulm, DE
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to handle login on Web-Applications

    Thanks for your replies.

    Baseer: I tried what you said and it didn't work for me. It would not fill in the fields for username and password in the first page, and the testscripts (well actually I tried to run the defaultappstate, which is supposed to bypass the login page and take me to the mainpage of the application) stops at the login page without any error messages, but without loggin the user in either !?!

    My solution: I defined a new application state that will be passed to each of my testcases and till now it works fine. Anybody has a better solution?

    Thanks

    ------------------
    Silverter - A profi was once a beginner
    Silverter - A guru was once a beginner

  6. #6
    Member
    Join Date
    Jan 2001
    Location
    Westborough, mA, USa
    Posts
    91
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to handle login on Web-Applications

    Define a method - BaseState() under your main window declaration- which logs in to your application.
    This overrides the DefaultBaseState() method.
    Hope this helps

    Regards

    ------------------

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to handle login on Web-Applications

    Sandeep is right.

    Define a BaseState () method inside your wMainWindow.


    const BP = BrowserPage
    BP.HtmlTextField ("$user").SetText (sUser)
    BP.HtmlTextField ("$pwd").SetText (sPwd)
    BP.HtmlPushButton ("Login").Click ()
    Browser.WaitForReady ()

    Change the tags to match your site and define sUser and sPwd.

    Hope this helps. Email me if you need further assistance.




    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  8. #8
    Member
    Join Date
    Nov 2000
    Location
    Ulm, DE
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to handle login on Web-Applications

    Thanks alot for your replies. The idea with the Basestate works perfectlly.

    regards,

    ------------------
    Silverter - A profi was once a beginner
    Silverter - A guru was once a beginner

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:02 PM.

Copyright BetaSoft Inc.