SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    dynamic name mapping

    Hi again,

    I would like to know whether it is possible to do name mapping dynamicly, as the script runs, and I'll explain:

    I have a unique attribute to all my objects (web application), but it is not the 'Name'.
    I would like to write a function that runs at the beginning of every test, finds an object according to this unique attribute, and gives it a name, so it can be used as a mapped name (for a more readable script).
    I hope I'm being clear...

    Does anyone have an idea how to do this?

    Thanks

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    473
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: dynamic name mapping

    Hello Oshrat,

    In the current version of TC, the Name Mapping feature is not accessible from script.

    But you can create a function that will return the needed object. In this case you will be able to access the object by this function name:
    [JScript]
    function CButton()
    {
    var p, w;
    p = Sys.Process("calc");
    w = p.Window("SciCalc", "Calculator");
    return w.Window("Button", "C", 74);
    }

    function Multiply()
    {
    var p, w;
    p = Sys.Process("calc");
    w = p.Window("SciCalc", "Calculator");
    return w.Window("Button", "**");
    }

    function Test1()
    {
    Win32API.WinExec("calc", SW_SHOW)

    var p, w
    p = Sys.Process("calc")
    w = p.Window("SciCalc", "Calculator")
    w.Activate()
    w.Window("Button", "4").Click()
    Multiply().Click()
    w.Window("Button", "5").Click()
    w.Window("Button", "=").Click()
    CButton().Click()
    }


    Cheers,
    Atanas

  3. #3
    Senior Member
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: dynamic name mapping

    It looks interesting. I'm going to check this option.
    Hopefully, it will be faster than using Page.Find which is too slow for me...

    Thanks alot!

 

 

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

Copyright BetaSoft Inc.