Hi,
I am facing a problem with Drop down in a grid cell.
Following is the description of the problem
QTP version : 10.00
NetAdvantage version : 2010 vol2
TestAdvantage : 2010 vol2
I have a grid with 2 columns. One of the columns contain a drop down with pre populated items. This list of items is same for all the rows.
When I try to change the value of a cell, by selecting a different item from the drop down, based on some validations, a warning dialog may be displayed. User can select OK/Cancel on the warning dialog.
The code I used to simulate a grid drop down is given below
Call SwfWindow("window").SwfTable("grid").ActivateCell(rowIndex, colName)
Call SwfWindow("window").SwfTable("grid").PerformAction(gridEnterEditModeAndDropdown)
Call SwfWindow("window").SwfTable("grid").SetCellData(rowIndex, colName, value)
Call SwfWindow("window").SwfTable("grid").PerformAction(gridCloseDropdown)
Call SwfWindow("window").SwfTable("grid").PerformAction(gridExitEditMode)
This code behaves quite inconsistenlty.
If i change the value of a cell which pops up the warning dialog, this code works i.e warning dialog is shown. If I first change some rows which doesnt showup the warning dialog and later try to change some other cell to a value which popsup a warning dialog, the code doesnt work i.e the value gets changed without popping up the warning dialog.
To explain the scenario more elaborately,
Let us say I have three rows in the grid.
I want to change the values (of 2nd column) in row 1 and 2 which will not popup any warning dialog.
I want to change the value in row3 which will give a warning dialog
If I directly change the value in the 3rd row first, I get warning dialog.
If I first change rows 1 and 2 and then try to change row3 to the value which generates warning dialog , the warning dialog doesnt appear.
The code is implemented using AfterCellListCloseUp to handle the selection in the list. Can you let me know if I am missing anything in my code.
Please let me know If any more informatjon is needed.
I figured out this.
Setting the "DropedDown" property of the required cell will close the drop down programatically and raise the event.
But this happens synchronously. The system pops up the required dialog and waits synchronously.
Can anybody suggest invoking this event asynchronously?
Thanks & Regards,
Satish
The inconsistency issue that you are facing does baffle me, I imagine it may be a mix of how the update is happening in the row itself. But as you found a means to make it consistent. Lets work on that part for you.
Unfortunately currently there is no way to change on the fly on what thread a particular action is run. Although we are looking into adding that as a feature in a future release. I would suggest a variation on the solution I offered here: http://community.infragistics.com/forums/p/56984/291536.aspx#291536
You can use Check to see if it is dropped down, and if so click it closed. The click will happen asynchronously. You will need to modify where the click happens, as the center click will not work. Likely this should work:
grid.Click x + width - 5, y + (height/2)
This is not an ideal scenario, and this is another reason why we are looking to add the ability to change the what thread an action is done on, but unfortunately I do not believe it is something we can add to 10.2.
Let me know if this works for you,