Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Error when running script that sets cell data for dropdown in swfTable
posted

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.

Parents
  • 22852
    Offline posted

    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.

    Alan

Reply Children