Skip to content

Infragistics Community Forum / Test Automation For Micro Focus Uft Windows Forms / Re: Get data of dropdown object in the SwfTable

Re: Get data of dropdown object in the SwfTable

New Discussion
Rafael
Rafael asked on Jul 29, 2009 9:27 PM

Hello Alan,

I have a similar situation also using QTP 9.2 and the method descried above (copied below) works for me. Thanks for the info.

However, I have one more step to verify the functionality of that combo box: I need to select one of the values. How do I do that? Thanks in advance for your help.

Note: Normal usage is, I click on pull down, click on a value, click somewhere else and the value is now displayed and remais as the selection. I need to have a QTP script do that.

 

= = = =================

Dim ItemCount
ItemCount = SwfWindow(“Form1”).SwfTable(“ultraGrid1”).GetNAProperty(“DisplayLayout.Bands[0].Columns[Department].ValueList.ValueListItems.Count”)

Dim strValues
strValues=””
For i = 0 to ItemCount -1 step 1
strValues = strValues & “, ” & SwfWindow(“Form1”).SwfTable(“ultraGrid1”).GetNAProperty(“DisplayLayout.Bands[0].Columns[Department].ValueList.ValueListItems[” & i & “].DataValue”)
Next

= = = =========================

 

Sign In to post a reply

Replies

  • 0
    [Infragistics] Vince McDonald
    [Infragistics] Vince McDonald answered on May 12, 2009 8:11 PM

    So that we can keep track of each individual question being asked, I’ve split this as a new thread.  Below is a link to the original thread:
    Get Dropdown Data from SwfTable in UFT Windows Forms

  • 0
    Alan Halama
    Alan Halama answered on May 12, 2009 8:24 PM

    Hello,

    Typically you would use the SetCellData method of SwfTable to set the value of the grid cell.  On replay, this won't actually drop down the combo box, but will select the value if it is valid and fire the relevant grid events. 

    The best way to see the syntax for what to pass into SetCellData is to record setting the value on a cell in the grid as this will give you the appropriate values for the row and column parameters to this method.

    Let me know if you have any questions with this matter.

    Alan

    • 0
      Rafael
      Rafael answered on May 29, 2009 11:17 PM

      Alan,

       

      In this particular case I can’t use SetCellData because I need to select a value rather than enter one. In our particular functionality requirements for this application, a user must be able to:

      1. See all the current values (done with following example:
        1. GetNAProperty("DisplayLayout.Bands[0].Columns[Department].ValueList.ValueListItems[" & i & "].DataValue")

       

      1. Type in a valid value not found in the list. Done with following example:
        1.  SwfTable("ugFuseStrings").SetCellData "0","DisplayModeSetting","2.22"

       

      1. Select a current value from the list.  No idea how to do this.

       

      When I use Record in QTP 9.2 for the action of selecting a value by clicking on it, the code comes out using SetCellData so this is not what I need (example below):

      SwfTable("ugFuseStrings").SetCellData "0","DisplayModeSetting","4.444"

       

       

      I need help on how to do #3 above.

      • 0
        Alan Halama
        Alan Halama answered on Jun 1, 2009 6:51 PM

        Hello,

        When a value list is used within the WinGrid, selecting a value from the list through the UI will set the cells value to the value from the list.  As such, SetCellData will have the same result as if the user were to click the drop down and select a value themselves.

        My recommendation is to use SetCellData for both entering a value in the list and entering a value that isn't in the list and then also simply verify the contents of the list by getting each item in the list.

        If you still find that it is necessary to drop down the list and select a value, you could Click method passing in the x and y coordinates or you could use QTP to do a low level recording.  Both approaches would be more difficult to read and maintain than using SetCellData.

        Let me know if you have any questions with this matter.

        Alan

      • 0
        Rafael
        Rafael answered on Jun 3, 2009 3:28 PM

        Alan,

         Thanks for the clarification and the hint on using Click x, y.

        I am still concern that using ".SetCellData "123" to "select" that value from the list might mask an issue with access to the list. This is because it might simply enter the indicated value as a new value anyway. When we use, for example “If value = …SwfTable("…").GetCellData(row, col)" in .NET the test will only pass if the value at that cell is selected because you are not providing it in the statement.

         It would be great if a “.GetCellData” method was available for Infragistics dropdown object in the SwfTable.

        I will try the .Click x,y method.

        Thanks for your help

        Rafael.

      • 0
        Alan Halama
        Alan Halama answered on Jun 5, 2009 7:26 PM

        Rafael,

        I am not clear on the details of what your concern is or what you would like with a GetCellData method for the drop down.

        What would GetCellData for the drop down return?  What are the cells in the drop down? 

        Alan

      • 0
        John
        John answered on Jul 29, 2009 7:58 PM

        have you found a way to select value from the drop-down list? I am having the same issue. I can't run setcelldata since the cell is read-only…

      • 0
        Rafael
        Rafael answered on Jul 29, 2009 9:27 PM

        I have not pursued this any more. We decided to limit how much to test from the third party objects and concentrate on validating that the application use of it works. In my case the cell is read/write, so I am just using the SetCellData xxx as a way to test that the value will be loaded in to the cell.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Rafael
Favorites
0
Replies
8
Created On
Jul 29, 2009
Last Post
16 years, 8 months ago

Suggested Discussions

Tags

No tags

Created by

Created on

Jul 29, 2009 9:27 PM

Last activity on

Feb 11, 2026 11:07 AM