SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    May 2006
    Location
    Israel
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Adding Dynamic object to GUI map file

    Hello!

    using WR 8.2

    I have dynamic object, each time it name changes.
    Each time i store it name in variable Name, i am trying to add this object to GUI map file.
    In this case i store Bull5493 Stam902502 in Name variable
    The Physical Description of this object should be:
    {
    class: object,
    MSW_class: html_text_link,
    html_name: "Bull5493 Stam902502"
    }

    code:

    if(fFindStringInWindow("Under Review Signed up Customers",Name) == E_OK)

    GUI_add(Path_To_Gui_Map,"Under Review Signed up Customers",Name,"{class: object,MSW_class: html_text_link,html_name:"Name"}");

    Where is my mistake?

  2. #2
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    The format you have, you would need to have a window titled "Under Review Signed up Customers" already in the GUI map for it to add.

    Also, are you sure the concatentation in the physical description part of your string is working? I know just tapping the variable in the running string works most of the time, but I am not too sure how it works in the since of a function paramter. Try it with using & to build the string instead of counting on WR to pull it together
    Insanity: doing the same thing over and over again and expecting different results

  3. #3
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    Tony, I don't think the problem is with the concatenation.
    Notice that the html_name contains a space.
    This requires it to be enclosed in quotation marks inside the physical description:

    <font class="small">Code:</font><hr /><pre>
    GUI_add(Path_To_Gui_Map,"Under Review Signed up Customers",Name,"{class: object,MSW_class: html_text_link,html_name:\""Name"\"}");</pre><hr />

    Or, as I would prefer:

    <font class="small">Code:</font><hr /><pre>GUI_add(Path_To_Gui_Map,"Under Review Signed up Customers",Name,"{class: object,MSW_class: html_text_link,html_name:\"" &amp; Name &amp; "\"}");</pre><hr />

    Or, as I would really prefer:

    <font class="small">Code:</font><hr /><pre>_set_window("Under Review Signed up Customers",5);
    web_link_click("{class: object,MSW_class: html_text_link,html_name:\"" &amp; Name &amp; "\"}");</pre><hr />

  4. #4
    Junior Member
    Join Date
    May 2006
    Location
    Israel
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    Tony, thanks for your response, of course i have a window titled "Under Review Signed up Customers" already in the GUI map, but like you wrote and i think the same, i have concatentation problem in GUI_add function, i just can't figure out how it should be, but i am experimenting some ideas. I already tried the following:

    GUI_add(Path_To_Gui_Map,"Under Review Signed up Customers",Name,"{class: object,MSW_class: html_text_link,html_name:"Name" &amp; "}"&amp;");

    but it still NOT working.Ok, tomorrow is a new day, will see.

    thanks, best wishes and regards.

  5. #5
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    bpolitzer the comparison of the frist and second code blicks you posted is what I was attempting to refer to.

    I know WinRunner will most times handle not specifically using &amp; in a string concatenation, but I have seen where it won't accept within a paramter on some functions.

    I think I was trying to push for more correct coding in the TSL with saying use &amp; and see how it goes [img]/images/graemlins/smile.gif[/img]

    We'll see what UriMat comes back with tomorrow
    Insanity: doing the same thing over and over again and expecting different results

  6. #6
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    Tony:

    I'm well aware that you were referring to the difference between "{class: object,MSW_class: html_text_link,html_name:"Name"}" and "{class: object,MSW_class: html_text_link,html_name:" &amp; Name &amp; "}"

    What you failed to point out is the difference between "{class: object,MSW_class: html_text_link,html_name:"Name"}" and "{class: object,MSW_class: html_text_link,html_name:\"" Name "\"}"

    Without the inner quotes, and with the space inside the html_name, it definitely will be broken, even with the "&amp;" operator.

    With the inner quotes, and without the "&amp;" operator it may or may not be broken.

    Therefore the troubleshooting principle of Occam's razor would dictate that you try the inner quotes first, and the anpersand operator second.

    That being said, I agree that the ampersand concatanation operator should always be used for good style and readability. I've never seen a case where omitting the ampersand causes a problem, but I never place myself in that situation to begin with.

  7. #7
    Moderator
    Join Date
    Mar 2000
    Location
    Orange County, CA
    Posts
    3,187
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    Standing in the corner labeled "corrected" [img]/images/graemlins/wink.gif[/img]

    and what this tells me is 1) I need to go get my eyes checked, or 2) need to stop sitting in front of a computer 14 hours a day!

    Thanks Brett - appreciate it [img]/images/graemlins/laugh.gif[/img]
    Insanity: doing the same thing over and over again and expecting different results

  8. #8
    Junior Member
    Join Date
    May 2006
    Location
    Israel
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    bpolitzer,

    This is realy, i mean realy great! Now i don't even need to add the object to GUI map file, your solution is very elegant,because i thought that each time i will need to use GUI_add and then GUI_delete functions(complex approach), but now i see how simple it is!

    Thank you very much!

    Best wishes and regards

  9. #9
    SQA Knight
    Join Date
    Jun 2002
    Location
    Cupertino, CA, USA
    Posts
    2,164
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Adding Dynamic object to GUI map file

    I tend to stay away from most of the GUI_ functions.
    What genius decided to name the function which gets the operating system GUI_get_name ?
    Something wrong with get_os ?

 

 

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 10.71%
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 01:40 AM.

Copyright BetaSoft Inc.