Hi
I'm using NetAdvantage for .NET 2006 V2 & QTP 9.5
I need to know if a cell inside SwfTable is a check box.
What is the way doing it?
Thanks,
Uri.
P.S.
SwfTable(grid).GetNAProperty is not recognized by QTP, I'm using the SwfTable(grid).Object method
Hi Uri,What version of TestAdvantage are you using? There is different way to embed a check box inside a cell. Can you check with the developer how he did it?Here is one (assume the cell is the first one on the first row).GetNAProperty("Rows[0].Cells[0].Column.Style")If the returned value is 3 (which is an equivalent to ColumnStyle.CheckBox Enum option. Or if the return value is 0 (ColumnStyle.Default) and .GetNAProperty("Rows[0].Cells[0].Column.DataType") return Boolean then a check box will be displayed. Also CheckBox can be displayed by assigning an embedded editor to a column that is a checkEditor .GetNAProperty("Rows[0].Cells[0].Column.EditorControl") Hope that helpAmmar
Hi Ammar,
Thanks for the help.
The application is written with NetAdvantage for .NET 2006.3 CLR 2. I do not have TestAdvantag. I will check with the developer how he did it but I guess I will have to use one of your suggestions
GetNAProperty does not recoginzed by QTP I get the error "Object doesn't support this property or method: 'Object.GetNAProperty' is there is a way using it without GetNAProperty ?
I tried converting it to something like .Object.Rows.Item(0).Cells.Item(0).Column.DataType that returns general error
To clarify last post, the way I use the GetNAProperty:
Window(Win).Window(Win).SwfObject(Grid).SwfTable(Table).GetNAProperty("Rows[0].Cells[0].Column.Style")
Hi Uri,
From the Cell there is a property called EditorResolved which evaluates to a type of Infragistics.Win.CheckEditor regardless of which method was used to set it to be a check editor. The problem is, not all objects translate well and offer all available methods when you use the .Object property supplied by QuickTestProfessional. That is one of the reasons we offer additional means of getting properties using TestAdvantage such as through GetNAProperty. Or in this case I would use GetCellProperty in which case you could do:
Window(Win).SwfTable(Grid).GetCellProperty("iRowNumber", "iBandNumber;sColumnName","sPropertyName")
So for regardless of how the check column was set if it displays as a checkbox the following should return "Infragistics.Win.CheckEditor"
MsgBox Window(Win).SwfTable(Grid).GetCellProperty("0", "0;CheckColumn", "EditorResolved").ToString()
I apologize for the mixed answer, but in one response you said you do not have TestAdvantage, then the next you said you can use a TestAdvantage method. If you are using TestAdvantage the easiest method would be the line I demonstrated above, otherwise you may need to validate it by other means, such as by the column's key.
I hope this has provided some assistance,
Hi Mike,
I don't have TestAdvantage. At some of the answers at this forum there was GetNAProperty usage. I didn't knew the usage of this method requires TestAdvantage so at the first post I wrote it does not work for me. At the last comment of mine I showed how I tried using the GetNAProperty trying to figure out why it doesn’t work.
I'm sorry for the confusion.
I tried using the code .GetCellProperty(0, 0, "EditorResolved").ToString but it returns general error. Getting the "value" property using .GetCellProperty(0, 0, "value") seems to work.
Is there is a way of checking it using the .Object method?
I tried converting Ammar's solution using the .Object method to Window(Win).Window(Win).SwfObject(Grid).SwfTable(Table).Object.Rows.Item(0).Cells.Item(0).Column.DataType" . The way I tried to convert Ammar’s code is probably mistaken, I don't know exactly how to convert it. Thanks for the help,Uri.