SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 1999
    Location
    Oakland, CA USA
    Posts
    3
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Declaring a URL Address from a Script

    I'm a pretty new user of SilkTest (2 weeks), and I'm wondering if anyone has a quick code slice to declare a browser address from a Test Script by passing part of the browser address from the Test Plan.

    For example, I'd like to pass in the:

    mainSegue.html

    text to the base:
    http://www.beta-soft.com/html /

    to get the:
    http://www.beta-soft.com/html/mainSegue.html

    (Page we're on now, see above!)

    IE 5.0, SilkTest 5.0.......

    I tried using a String, passing data from the Plan to a SetLocation (Not the right one :| )and similar type methods.

    Any assistance would be appreciated.

    K

  2. #2
    Guest

    Re: Declaring a URL Address from a Script

    I'm not sure I get you but here's a try:

    string sLocation = "http://www.betasoft.com/html"

    sLocation = sLocation + "mainSegue.html"

    Browser.Location.TypeKeys ("{sLocation} ")

    The reason whu I have an extra space at the end is because that is a workaround for any URL caching.
    I also have TypeKeys() instead of SetText() because it also is a workaround for URL caching.

    Otherwise if you are trying to append to an existing URL and you have no idea what the current URL is:

    sLocation = Browser.Location.GetText ()
    and then do the next 2 steps above.

    Hope that helps a bit.

    -AJ Alhait.

    PS the "proper" location for the Segue forum is http://www.betasoft.com/forums/segue

    I purchaced betasoft.com so you can use it without the "-" or with doesn't matter. But the site will slowly migrate to without.



  3. #3
    Junior Member
    Join Date
    Jul 1999
    Location
    Oakland, CA USA
    Posts
    3
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Declaring a URL Address from a Script

    AJ,

    Thanks for the quick turnaround. I actually solved this right before I left around 7pm this evening....it's a variation on your theme, and I got some help from BBoling's hotmail example (way below). This is what I needed:

    Testplan
    URL1
    {" mainSegue.html"} //Test Data definition

    Test Script
    //
    String sURL
    //
    Browser.Location.SetText ( "http://www.beta-soft.com/html/ {sURL}"))
    Browser.Location.TypeKeys ("<Enter>")

    The result was:
    http://www.beta-soft.com/html/mainSegue.html

    The real application of this example was actually a little more complicated, but it works!

    Again, thanks for your assistance,

    Kevin

  4. #4
    Junior Member
    Join Date
    Jul 1999
    Location
    SF, CA, USA
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Declaring a URL Address from a Script

    If I understood you...
    declare a string
    STRING sMain mainSegue.html
    you can do it in your include file.
    from your script you do the following
    Browser.Location.SetText ("http://www.betasoft.com/html/" + sMain)
    Browser.Location.TypeKeys ("<Enter>")
    Hope that helps
    Hagay

 

 

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 03:47 AM.

Copyright BetaSoft Inc.