I am trying to write a test to validate if specific column names (headers) exist or not. I was hoping I could get the object.ColumnCount (which works) then iterate through each column index grabbing the Key property, something like the following:
oObject.GetNAProperty("DisplayLayout.Bands[0].Columns[1].Key")
I cannot get this line to work properly, it is failing, maybe it doesn't like my syntax. I know the Bands is correct because I can pull property values that are a direct child of Bands[0], I just can't seem to get inside the Columns collection.
Thanks
I think this forum thread might help: http://community.infragistics.com/forums/p/25150/92258.aspx#92258
Yeah, that's exactly what I did, does not work for me.
As I flipped back to that machine to pull up the AUT and script, both QTP and the AUT crashed together, random exceptions. I opened both back up and ran the script again, not changing a thing, and it did pull the value this time. So I guess from before there was some failed thread that kept QTP from running correctly, I don't know, very strange, but same code works without error now. Thanks
Here's the code in case you were curious, thanks for your help.
Set oParent = SwfWindow("C1Home")Set oObject = oParent.SwfTable("GridDataTable")oObject.WaitToExist 10, TRUE
iColumns = oObject.ColumnCountmsgbox "Total Columns = " & iColumnsFor i = 0 to (iColumns - 1) Reporter.ReportEvent micDone, oObject.GetNAProperty("DisplayLayout.Bands[0].Columns[" & i & "].Key"), "..."Next
QTP seems to get confused or hung up at times, so I'm glad to hear that you got it to work.
Also, thank you for sharing your code as it's always interesting to see how others do things!
Hi,
I am able to find out Key for a column using .Net spy tool. I found the key on below path :- DisplayLayout.Band[0].Column[2].Key.
But when I am trying to run the below code :- SwfWindow("FIDPG CreditOne - New").SwfWindow("Quote Sheet").SwfTable("UltraGrid").GetNAProperty("DisplayLayout.Band(0).Columns(2).Key") I am getting following error :- DisplayLayout.Band(0).Columns(2).Key is overhalmed.
Please suggest me solution.
But when I am trying to run the below code :- SwfWindow("FIDPG CreditOne - New").SwfWindow("Quote Sheet").SwfTable("UltraGrid").GetNAProperty("DisplayLayout.Band(0).Columns(2).Key") I am getting following error :- DisplayLayout.Band(0).Columns(2).Key is malformed.
Hello,
Thank you for contacting Infragistics.
In giving you the answer below, I'm assuming you did not make any typing mistakes when creating your post.
The code you passed into the GetNAProperty() method refers to the Band collection when it should be plural: "DisplayLayout.Bands(0).Columns(2).Key".
Please let me know if you have any other questions about this.