SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Moderator
    Join Date
    Apr 2001
    Location
    Atlanta, GA, USA
    Posts
    2,167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Regular Expression w/o common string

    WR: 7.5
    IE: 6

    Our web application has a popup window that I need to automate. This window can appear from a number of different screens. It's name (TITLE) is based off the screen it was activated from.

    Example:
    Mission Statement
    Description
    Justification

    All those names/TITLEs come from different screens, yet the window is identical for all of them.

    The window has 34 objects, and I'd like to have just one GUI Window object if possible. Which means I'd need to have an "html_name" property that is a regular expression.

    I've done regular expressions where there's some common string (ie: "!Prev - .*" for mutltiple 'Prev' buttons), but I'm not sure where to go when there's no common string.

    Thanks for the help.

    ------------------
    WinAmp. Llama Tested. Mother Approved.
    Jordan Gottlieb - Keeper of the QA Forums FAQ
    Qualitech Solutions, Inc.
    jgottlieb@qualitechsolutions.com
    Jordan Gottlieb
    Senior Consultant, Orasi Software
    Twitter: @JG_QA

  2. #2
    Points for Confirmed Friends
    Guest

    Re: Regular Expression w/o common string

    The standard for regular expressions ".+" is that represents any string.

    I can't remember whether WR follows that standard though.


    ------------------
    GUI automation is GUI automation. It is not testing.

  3. #3
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Regular Expression w/o common string

    "!.*" would mean any string.

    If that turns out to not be specific enough (i.e. the rest of the GUI definition doesn't make the window unique), you could use "![MDJ][ieu]s[sct][ir].*" to key on the first 5 letter of:

    Mission Statement
    Description
    Justification

    ------------------
    Charles Reace

    #!/usr/bin/perl
    my @email = qw(charles reace verizon net);
    printf("%s.%s@%s.%s\n", $email[0], $email[1], $email[2], $email[3]);
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

  4. #4
    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: Regular Expression w/o common string

    Find a physical description which uniquely identifies these windows. Try using an attribute other than title, such as owner or nchildren. Then use _set_window with the physical description:


    ################################################## ############################
    _set_window("{class: window, owner: \"iexplore.exe\", MSW_class: Dialog}");
    _set_window("{class: window, owner: \"iexplore.exe\", nchildren: 34}");
    ################################################## #########################


    Use GUI_set_window with the logical name of the window in the gui map file:


    #################################
    GUI_set_window("MyAppWindow");
    #################################

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

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Posts
    216
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Regular Expression w/o common string

    User Misha (mm_ke@yahoo.com.nospam) posted:

    Hi Jordan

    There are several alternatives I can see for your situation, perhaps one of
    them is appropriate:

    1. If the window is unique even without the title, remove the title/label
    from the GUI map, so any title will match

    2. Set up a regular expression in the GUI map to match any of the three
    strings. This is a bit unwieldy, especially where things might change, or
    you want to add strings, but you could do something like:
    "![MDJ][ieu]s[sct].*"
    or even
    "![A-Z][a-z][a-z A-Z]*"
    It really depends on what you dont want it to match.

    3. (runtime) Extract the physical description from the GUI map, then loop
    through the three titles, setting the physical description to each and
    trying win_exists, if one does exist you can then set it in the GUI map as
    well and continue as normal. This would be more to determine which window
    you have, once you know you have one of them.

    Do you want to set up an exception handler for this window? If so, you could
    do a combination of the above...

    Kind regards,
    Misha

    ----- Original Message -----
    From: jgottlieb <jgottlieb@q...>
    Date: Mon Aug 12, 2002 11:31 am
    Subject: Regular Expression w/o common string

    WR: 7.5
    IE: 6

    Our web application has a popup window that I need to automate. This window
    can appear from a number of different screens. It's name (TITLE) is based
    off
    the screen it was activated from.

    Example:
    Mission Statement
    Description
    Justification

    All those names/TITLEs come from different screens, yet the window is
    identical
    for all of them.

    The window has 34 objects, and I'd like to have just one GUI Window object
    if
    possible. Which means I'd need to have an "html_name" property that is a
    regular expression.

    I've done regular expressions where there's some common string (ie: "!Prev -
    .*" for mutltiple 'Prev' buttons), but I'm not sure where to go when there's
    no
    common string.

    Thanks for the help.
    ------------------
    WinAmp. Llama Tested. Mother Approved.
    Jordan Gottlieb - Keeper of the QA Forums FAQ

  6. #6
    Points for Confirmed Friends
    Guest

    Re: Regular Expression w/o common string

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Charles Reace:
    "!.*" would mean any string.

    <HR></BLOCKQUOTE>

    See what I mean.

    I don't believe ! is a significant character in any other regular expression engine.

    ------------------
    GUI automation is GUI automation. It is not testing.

 

 

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

Copyright BetaSoft Inc.