Results 1 to 2 of 2
  1. #1

    To identify Listbox items by Index

    Hi all,

    I am testing a web-application with Robot.

    It has a list box that contains dynamic data so that identifying the items with TEXT is not possible. I need to select the items with index.
    Also SQASetProperty for SelectedIndex is not possible as multiple items must be selected. I think there should be a way to do this with index of the items, but Index doesnot work with Listbox. I cannot find any way of doing it, other than extracting the innerHTML and parsing it, which is quite cumbersome.
    Can anyone please help with some more practical solution?
    Sayantani from India

  2. #2

    Re: To identify Listbox items by Index

    If you don't know what the text is, how is selecting by Index going to help you?

    If you don't need the text, simply click on the Listbox and select the Down key to select whatever item you want in the list, e.g., ListBox Click, "Name=<objName>" 'Expands the listbox
    InputKeys "{DOWN 3}" 'Replace 3 with whatever index you want to select.

    Otherwise, you'll have to parse out the values and select by Text.

    'Get values from Object
    Result = SQAGetPropertyAsString("<TableCellName>","in nerText",RtnValue)

    'Find the value in the RtnValue, either by InStr or GetField if using Chr(10) or something similiar.

    Good Luck
    Tom B.
    Automation Team Lead
    Rental Quality Assurance
    Enterprise Rent-A-Car



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:17 PM.

Copyright BetaSoft Inc.