I'm using QTP 9.2 with TestAdvantage 2006 v2 CLR 1.x and I would like to know how I can determine if a cell in an UltraGrid has a status of "Allow Edit" or "No Edit". Certain cells in the grid of our application should have a status of "Allow Edit" all of the time, while other cells should have a status of "No Edit" only in certain instances, so I'm trying to check those in my test scripts.
I've spied on the grid with the .Net Object Spy and found the following: Display Layout > Bands > 0 > Columns > (Column Name) > Row Layout Column Info > Column > Cell Activation > AllowEdit, which I assume is the property I'm needing, but I'm not sure of the syntax for my test scripts to return that property. Here is an example of my scripts, but I'm obviously doing something wrong as when I message box the second line, I get an empty message:
SwfWindow("Company Name").SwfWindow("Purchase Order for Branch").SwfTable("ultraGrid1").ActivateCell "0","QuantityReceived"
SwfWindow("Company Name").SwfWindow("Purchase Order for Branch").SwfTable("ultraGrid1").GetROProperty ("CellActivation", "AllowEdit")
I've only been using TestAdvantage with QTP for about a year, so any help will be appreciated. Thank you!
Hi Amar, I wanted to add a "Selected" Boolean column to my WinGrid (2008vol3) and set its property to AllowEdit but make all other columns (= bounded while "Selected" column is not) readonly.
With this way I want to let the user choose if he selects the rows by clicking on the checkbox in the Selected column or the usual Windows selection type (with shift and ctrl). But now I can't check or uncheck the checkboxes in the "Selected" Column.
Can you help me?
Regards,
Andy
After doing some additional investigation and experimentation, I've learned from our developers that ("ActiveCell.Column.CellActivation") can be used to determine the edit status of the cells in a particular column, but ("ActiveCell.Activation") can be used to determine the Edit status of a particular cell. The lines of code look something like this:
SwfWindow("Company").SwfWindow("Purchase Order").SwfTable("ultraGrid1").ActivateCell "0","QuantityReceived"QtyRecCell = SwfWindow("Company").SwfWindow("Purchase Order").SwfTable("ultraGrid1").GetNAProperty("ActiveCell.Activation")MsgBox QtyRecCell
I hope this additional information helps!
If you record selection the item from the list inside the cell then move out of the edited cell you will see that "SetCellData" action will be recorded. This action sets the value property of the grid's cell. There is no action to act on the embedded combo, in fact the embedded combo cannot be added as a test object because its embedded inside the grid cell. However you can try to simulate the action using generic keyboard actions:
SwfWindow("...").SwfTable("ultraGrid1").ActivateRow "1"SwfWindow("...").SwfTable("ultraGrid1").ActivateCell "1","Item"
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{F2}"WshShell.SendKeys "{ALT+Down Arrow}"WshShell.SendKeys "..." ' a number of arrow to select the right item, or if the combo support type and auto complete then type the item text you want to selectWshShell.SendKeys "{TAB}" ' to move out of the edited cell so that the next cell Combo is populated.
Hope that will help.
Ammar
Hi ,
Im facing the following problem with an SwfTable
I have a listbox in each cell of the SwfTable.I have to select an item from the list in each cell of the SwfTable.
I used the Select Cell and Activate Cell but its throwing Run time error. Can someone help me!!!
Hi Mike,
Thank you for your Great Support...
Sridhar