SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    SQA Knight
    Join Date
    Jan 2002
    Location
    Highlands Ranch, CO, USA
    Posts
    2,860
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    DotNetFactory form using .NET ListBox objects

    After doing multiple Google searches and looking here via search I've decided to post this question and see if anyone else has a good idea/solution.

    In QTP 9.5 I've used the DotNetFactory to build a form and put a .NET ListBox control on it for users to select the items to test in an application. I prepopulate the Listbox with the items, and get it on the form. It is setup as a MultiSelect control. All that works well.

    My issue is getting the information back from the ListBox object for what was selected by the user. I'm looking at the object definition and property/methods in VS2008 VB.Net to model what I need. There are a couple of methods (GetSelected, GetItemText) I'm trying to use and keep getting 'Exception Thrown' errors.

    I'm not sure what I'm doing wrong. Any ideas and/or help is appreciated. Thanks.
    Jim
    -------------------------------------------
    For all the general stuff to know about QA/Test go here http://www.softwareqatest.com/

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

    Re: DotNetFactory form using .NET ListBox objects

    Hi,
    GetSelected, GetItemText are not the right methods or properties to get the selected items in the list

    Ways to get selected items from list

    1) If your list box is not multi selected, it is very simple

    just use .Text property

    2) If you need to get multiple selected items from a list box then , you have use the SelectedItems collection object and then retrive the values from the collection

    use the following code

    For i=0 to objList.SelectedItems.Count-1
    msgbox "The Item you have selected Is: "& objList.SelectedItems.Item(Cint(i))
    Next


    please let me know weather it is working for you or not

 

 

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.40 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.7.1 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:41 AM.

Copyright BetaSoft Inc.