SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Nov 2009
    Posts
    54
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to work with dynamic option in a dropdown

    Hi,
    The application has a drop down list. A part of the value in the list is changing. For example: Lets say, an option is “Number of children- 20”. The value 20 is changing very often. When I recorded this test, it was “Number of children-20” . Now the option is “Number of children -40”. Thus QTP fails. I thought about regular expression. But I don’t know how to use. Can any body help me.

    Thanks.

  2. #2
    Senior Member
    Join Date
    Dec 2008
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to work with dynamic option in a dropdown

    What does the object spy give you when you try view it?

  3. #3
    Advanced Member Anshoo Arora's Avatar
    Join Date
    Oct 2007
    Location
    New Delhi, India
    Posts
    635
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to work with dynamic option in a dropdown

    [ QUOTE ]
    When I recorded this test, it was “Number of children-20” . Now the option is “Number of children -40”. Thus QTP fails.

    [/ QUOTE ]

    You can either match the selection string with a Regex, or use InStr.

    Below are 2 very simple patterns you can use in this scenario:

    Number of children\- .0
    "\D+\- \d+"
    Regards,

    Anshoo Arora
    Relevant Codes

  4. #4
    Member
    Join Date
    Nov 2004
    Location
    Chennai
    Posts
    40
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to work with dynamic option in a dropdown

    You can also try the below given,

    Number of children\- .*

    where ".*" matches with any character after the string "Number of Children-
    Parshi Pradeep

 

 

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 6.67%
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 06:52 PM.

Copyright BetaSoft Inc.