Hi,
I am working on .Net Window Application Automation by Using UFT11.53 + TestAdvanatge10.2 (Product Version: 10.2.20102.2023 ).
Please let us know how to get text color (fore color) of UltraWinGrid cell.
I tired with below line of code, but it doesn't worked (Returning Empty).
Hi ,I am using the above code to get the colour of row using lean ft but not getting the colour.
Thanks,Dimita.
Now able to get cell forecolor.
Thanks for you support.
Hi Guru,
Thank you for the reply.
If the cell color is changed directly on the cells themselves, you could use the following code to get the text color:
msgbox SwfWindow("swfname:=frmMnForm").SwfWindow("swfname:=frmAment").SwfWindow("swfname:=frmAssessment_11").SwfTable("swfname:=ugPEGU").GetNAProperty("Rows["&rowIndex&”].Cells[“&colIndex&”].Appearance.ForeColor”)
Where rowIndex and colIndex are the indexes of the row and the column respectively.
Keep in mind that depends on the exact way the developers are setting the color of cells and in your case it may differ. So please communicate with your developers the exact way and code that they use in order to set the cell color. You can use that code in the GetNAProperty method in order to retrieve the respective property.
Please let me know if you have any additional questions.
Hi Hristo.
As i confirmed with developer they are not using Override method. They are assigning color to Cell text.
And, the color was applied on Cell. let us know the method to get cell color text.
Please let me know if you need any additional information?
Thanks,
Guru.
Hello ,
GetCellAppearance(….) method was introduced within the release of Infragistics TestAdvantage Windows Forms for HP 10.3, and tha is why you are getting this message when you try to use it.
About second approach:
The returned result shows that foreColor has its defeat value, i.e. no foreColor was set to “DisplayLayout.Override.CellAppearance.ForeColor” (which actually is the cell appearance for all cells of the grid). So in order to use this approach you should know the exact appearance object on which foreColor was applied. Can you confirm that your application apples fore color to UltraGrid.DisplayLayout.Ovveride.CellAppearance.ForeColor or this color was applied on cell, column or row level ?
Please let me know if you have any further questions.