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
385
Problem with Drop down in grid cell
posted

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.

 

 

 

 

Parents
No Data
Reply
  • 385
    posted

    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

Children