SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Apr 2008
    Location
    Virginia, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Combo Select Box issue

    Hi,
    I am working on a "web" application and in that I need to select a value from Combo box select dropdown. I recorded the script. When I try to run the script, I get runtime error " can not Identify the specified Item from the object" I am attaching the error screen and my object repository. I added more objects to make QTP understand what I want to select but no use. Please help. I am adding attachment.
    Attached Files Attached Files

  2. #2
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Combo Select Box issue

    Perhaps the object in the list has some special character which your local datasheet entry doesn't.

    What you need to do is split the weblist into an array, and interrogate the value you are interested in for vbCr or VbLf which are the usual characters that cause this.

    Mark Smith.

  3. #3
    Senior Member
    Join Date
    Jun 2007
    Location
    Toronto, Canada
    Posts
    362
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Combo Select Box issue

    are the 13 items you mentioned in the attachment static or do those change dynamically?

    If it is static..
    add a space to the end of the string that you are picking up from the datatable..it might work..not guaranteed though because sometimes the the values in the dropdown have blank spaces at the end which you might miss sometimes

    so if your string is "abcd" then try with "abcd "

  4. #4
    Member
    Join Date
    Oct 2003
    Location
    Norfolk, VA
    Posts
    360
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Combo Select Box issue

    You can add the following to a library and associate it with your test, you can then use the OR to extract the selections from your combo (e.g. comboItems = Browser("").Page("").WebList("").ComboIntoArray

    <font class="small">Code:</font><hr /><pre>RegisterUserFunc "WebList","ComboIntoArray","ComboIntoArray"
    '################################################# #####
    ' Loads a combobox into an array
    ' Parameters: Weblist object
    ' Returns: An array of all available selections within the Weblist
    ' Assumes that the item delimter is a semi-colon (
    '################################################# #####
    Function ComboIntoArray(obj)
    Dim Ar
    Set combo = obj
    c_count = combo.GetROProperty("items count")
    all_items = combo.GetROProperty("all items")
    ReDim Ar(c_count)
    Ar = split(all_items,";",-1,1)
    ComboIntoArray = Ar
    End Function</pre><hr />
    A good rule of thumb is to never measure with your thumb.

  5. #5
    Junior Member
    Join Date
    Apr 2008
    Location
    Virginia, USA
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Combo Select Box issue

    Thanks for the replies. I will try the scenarios and check if it works. I suspect there are spaces too ..

 

 

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.34%
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 11:39 PM.

Copyright BetaSoft Inc.