Version .... CLR 2 2006 vol2
I can access cell data in the table as in the following code but I'm not sure how to access grab the column names.
For i = 1 To CountColumns Col = SwfWindow("CaridianBCT Service Maintenanc").SwfTable("machineHistoryGrid").GetCellData(3, i)
Richard
If I'm understanding your post correctly, I think you'll need to use GetNAProperty, instead of GetCellData. We were able to use GetNAProperty to drill down into the column headers to pull such properties as the Key, Visible Position, Width, Hidden Status and Tag value, so I'm guessing you could do the same for the Caption. Here's an example of our code:
SwfWindow("Company").SwfTable("GridName").GetNAProperty("DisplayLayout.Bands[0].Columns[" & i & "].Key")
Of course, you'll have to use the .Net Windows Forms Spy to determine the Band number (once you've spied on the grid, go to DisplayLayout > Bands and find the number of the Band you need).
We use TestAdvantage 2006 Volume 2 CLR 1.x, so I'm assuming this could work for you as well.
Hope this helps!
Hey Dennis,
I'm having problems accessing my column names and nested column names...the GetNAProperty is not working for me...giving error saying method not supported.
I'm using QTP 11
Regards,
Ravi Salunkhe
Hey Georgi,
Yes, i figured that out but the problem with me is that the application is developed using Netadvantage 2012.1 and the trial patch that i have is of TestAdvantage 2012.1...so will that do?
And if yes then please help me out to with some code pieces!
Hello Ravi,
If I understand well your scenario, if your application using NetAdvantage version 12.1 and if you have installed TestAdvantage 12.1 at your machine, that you could use the code below to get the Column`s caption and Column`s key from your grid.
' Example how to use GetNAProperty to get Column`s key and Column`s CaptionDim captionDim columnKey
caption = SwfWindow("WinEditors Within WinGrid").SwfTable("ultraGrid1").GetNAProperty("DisplayLayout.Bands[0].Columns[1].Header.Caption")columnKey = SwfWindow("WinEditors Within WinGrid").SwfTable("ultraGrid1").GetNAProperty("DisplayLayout.Bands[0].Columns[1].Key")
msgbox(caption)msgbox(columnKey)
Please take a look at the attached video file with small demonstration
Let me know if you have any questions.
Regards
oops!...i just missed out.....actually the TestAdvantage setup i have is of 2012.2!...and thanks for the vid...will chk the code though!
Lemme get back to you on this...
You could download the trial version of TestAdvantage 12.1 from the link http://ko.infragistics.com/products/downloads/archived . By this way you could test your application .
I had installed the add-in with selecting as "free version", is this valid? as i'm unable to get the recorded script properly and it still takes the x,y co-ordinates.
while setting the filter and stuff.
If you still have any concerns or questions I will be glad to help. If you need any additional assistance don’t hesitate to ask.
REgards
Ravi Salunkhe said:I had installed the add-in with selecting as "free version", is this valid?
If I understand well your scenario, than the answer is: No. I suppose that your application using non version free assemblies. So you should choose the appropriate version (12. 1 CLR 2.0 or 12.1 CLR 4.0) depending of assemblies that you are using into your AUT. Please use the Version Utility tool to choose the right version and CLR