I am attempting to have QTP click on the dropdown in a row contained in an swfTable and select a dropdown item. I am using QTP 9.5 and Infragistics TestAdvantage 2008 Vol. 2 CLR 2.
If I use QTP to record the step I get something like this:
SwfWindow("eCareManager™ System").SwfWindow("Care Plan - Infectious Disease Popup").SwfTable("Infectious Disease Grid").ActivateRow "0"SwfWindow("eCareManager™ System").SwfWindow("Care Plan - Infectious Disease Popup").SwfTable("Infectious Disease Grid").ActivateCell "0","ResponseToTherapyValueID"SwfWindow("eCareManager™ System").SwfWindow("Care Plan - Infectious Disease Popup").SwfTable("Infectious Disease Grid").SetCellData "0","ResponseToTherapyValueID","7702c5ad613d43c2af6cc248daa4c9cf"
The code above Activates the row, then Activates the desired cell within that row, and then attempts to select the dropdown choice "Improving". But for some reason it marks "Improving" as "7702c5ad613d43c2af6cc248daa4c9cf" in the script.
When I run the script, whether using the dropdown item ID captured during recording, or changing the value to "Improving" within the script, I get the following error:
Unable to convert from 'System.String' to 'Visicu.Framework.OID' (sorry that I am including application-specific data in my submitted code, btw).
I need this information because I am creating a PopData action that reads a data table to determine if a dropdown item should be selected and if so which item in the dropdown list for each cell in the grid. But so far I haven't been able to get it to pick selections off of the dropdown menus. I have not had this problem with the PopData action I've designed that checks/unchecks checkboxes contained within each row. That action works fine because they are toggled with 'True' and 'False' parameters for the checkboxes. But TestAdvantage or QTP seems to be grabbing some sort of ID for each choice in the dropdown menus that can't be translated at runtime.
Any help would be greatly appreciated.
Balraj,
Is the issue specific to the one field/column that is a drop down or do you have the issue with other columns as well? Do you know how your developers have setup the drop down for the column? Are they setting an EditorControl or using a ValueList?
Please also provide the following information:
1. Version of QTP with all installed patches.2. Version of the .NET Add-In with all installed patches.3. Version of .NET runtime application was built with.4. Full version of NetAdvantage used in AUT.5. Full version of TestAdvantage.In QTP 9.0 and later the version of QTP and the .NET Add-In and patches can be obtained on the Product Information page. The product information page is accessible from the about window.To obtain the full version of NetAdvantage used in the AUT (application under test) you can look at the version of the NetAdvantage assemblies provided with the AUT or you can ask your developers. To obtain the version from an assembly, right click the assembly in Windows Explorer and select Properties. On the Properties dialog, from the Version tab, look for the Assembly Version.The full version of TestAdvantage being used can also be obtained from the assemblies. By default the TestAdvantage assemblies are located in the "C:\Program Files\Infragistics\TestAdvantage [version]\Bin" folder.Let me know if you have any questions with this matter.
Alan
Hi,
This is Balraj. I am also facing the same issue and tried the above solution.. but no luck. Anyother go?????
Regards,
-Balraj Goel
what if the drop-down list is read-only? Is there a way to select from the drop-down list since I can't run setcelldata...It complains I am writing to read-only cell..
Hello,
The value of the cell is what is recorded and then when playing a script, SetCellData sets the value of the cell directly rather than using the editor. In this case it appears that there is an issue with using the custom data type (Visicu.Framework.OID).
If your grid is set up so that you can also type into the drop down list column, then it is likely that you can use SetInvalidDataCell in place of SetCellData to set the value of the cell. This would require modifying what is recorded a little.
For example, the following line:
SwfWindow("eCareManager™ System").SwfWindow("Care Plan - Infectious Disease Popup").SwfTable("Infectious Disease Grid").SetCellData "0","ResponseToTherapyValueID","7702c5ad613d43c2af6cc248daa4c9cf"
would become:
SwfWindow("eCareManager™ System").SwfWindow("Care Plan - Infectious Disease Popup").SwfTable("Infectious Disease Grid").SetInvalidDataCell "0","ResponseToTherapyValueID","Improving"
Please test this approach if the cell allows you to enter values.
Let me know if you have any questions with this matter.
Follow up -
When I use the QTP .NET Spy I am able to see the dropdown list info for each row:
Type: Infragistics.Win.UltraWinGrid.UltraGrid
Controls Collection - ValueListDropDownUnsafe
ValueList Items: Members:
0 Null
1 Improving
2 No change
3 Worsening
4 Resolved
Data Value for 1 Improving = (Null) 7702c5ad613d43c2af6cc248daa4c9cf
Display Text for 1 Improving = Improving
Maybe this info helps?