SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    May 2002
    Location
    San Jose, CA
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Make default basestate login to webpage

    I'm basically new to SilkTest. I have a web app that I want to test. The 1st page of the app is a login page with fields for name, password and a 'Log In' button.

    I followed the directions in the help for the wStartup constant/Invoke method, but when I run the default base state, it doesn't actually login to the page. However, if I create a test case to login to the page, it works just fine. What did I do wrong?

    The include file is here.

    Also, when the app is 1st launched, the URL is http://localhost:8080/servicemanager/userlogin.aspx, but if a timeout occurs, the URL will look like this:

    http:// localhost:8080/ServiceManager/UserLogin.aspx?ReturnUrl=%2fServiceManager%2fHardw are%2fSpMgr.aspx

    Does that matter?
    Robin L. Siebler
    Software Test Engineer
    Palm
    -------------------------
    Garunteed to be bug free

  2. #2
    Senior Member
    Join Date
    Apr 2008
    Location
    Hyderabad
    Posts
    339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Make default basestate login to webpage

    Hi,
    I have a pair of questions here for you.

    1. Is "OnlineHardware" the first page opens when you start your appliaction?
    2. How will you move from "OnlineHardware" page to "User Login" page manually?

    If User Login is the 1st page try this.
    <font class="small">Code:</font><hr /><pre>
    const wMainWindow = UserLogin

    [-] window BrowserChild UserLogin
    [ ] tag "User Login"
    [ ]
    [ ] const sLocation = "http://localhost:8080/servicemanager/userlogin.aspx"
    [ ] // The login user name
    [ ] //const sUserName = "admin"
    [ ]
    [ ] // The login password
    [ ] //const sPassword = "foo"
    [ ]
    [ ] //const wStartup = UserLogin
    [ ]
    [ ] // The size of the browser window
    [ ] // const POINT BrowserSize = {600, 400}
    [ ]
    [ ] // Sets the browser font settings to the default
    [ ] // const bDefaultFont = TRUE
    [ ] parent Browser
    [+] Invoke()
    [+] if !Browser.Exists()
    [ ] Browser.Invoke()
    [ ] Browser.WaitForReady()
    [+] else
    [ ] Browser.CloseOthers()
    [ ] Browser.SetActive()
    [+] if !UserLogin.Exists()
    [ ] Browser.LoadPage("http://localhost:8080/servicemanager/userlogin.aspx")
    [ ] Browser.WaitForReady()
    [ ] UserLogin.SetActive()
    [+] else
    [ ] UserLogin.SetActive()
    [ ]
    [+] Login()
    [ ] UserLogin.UserName2.SetText("admin")
    [ ] UserLogin.Password2.SetText("foo")
    [ ] UserLogin.Login.Click()
    [ ] Browser.WaitForReady()
    [+] HtmlTextField UserName2
    [+] multitag "User Name:"
    [ ] "$ctl00$ContentPlaceHolder1$Login1$UserName"
    [ ] "&amp;id='ctl00_ContentPlaceHolder1_Login1_UserNam e';name='ctl00$ContentPlaceHolder1$Login1$UserName '"
    [+] HtmlTextField Password2
    [+] multitag "Password:"
    [ ] "$ctl00$ContentPlaceHolder1$Login1$Password"
    [ ] "&amp;id='ctl00_ContentPlaceHolder1_Login1_Passwor d';name='ctl00$ContentPlaceHolder1$Login1$Password '"
    [+] HtmlPushButton LogIn
    [+] multitag "Log In"
    [ ] "$ctl00$ContentPlaceHolder1$Login1$LoginButton "
    [ ] "&amp;id='ctl00_ContentPlaceHolder1_Login1_LoginBu tton';name='ctl00$ContentPlaceHolder1$Login1$Login Button'"
    </pre><hr />

    now whenever you want login call the above methods as follows:

    UserLogin.Invoke() // invokes the login page
    UserLogin.Login() // performs the login

    hope this helps you
    Regards,
    Krishna Chaitanya

    =====================
    Try and fail, but don't fail to try
    =====================

  3. #3
    SQA Knight
    Join Date
    Sep 2001
    Location
    Bangalore,India
    Posts
    2,549
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Make default basestate login to webpage

    Can you try or search for lwLeaveOpen?

    It will be useful, if you want to handle login window/dialog boxes.. Extend the basestate for login functionality.
    Thanks & Regards,
    Palani.
    http://tips-testing.blogspot.com/index.html
    Quote: Donít hesitate to initiate!

  4. #4
    Junior Member
    Join Date
    May 2002
    Location
    San Jose, CA
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Make default basestate login to webpage

    Thanks, that worked! [img]/images/graemlins/smile.gif[/img]
    Robin L. Siebler
    Software Test Engineer
    Palm
    -------------------------
    Garunteed to be bug free

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 12:13 AM.

Copyright BetaSoft Inc.