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).
Thank you for contacting Infragistics Developer Support.
Please try the following method and let me know if you are able to get the appearance this way:
If not you can get the appearance using the GetNAProperty. This requires knowledge of how the application itself can set the appearance. One example of a possible approach would be to use:
Thanks,I Worked on below methods as you suggested and it doesn't worked as expected.
msgbox SwfWindow("swfname:=frmMrm").SwfWindow("swfname:=frmment").SwfWindow("swfname:=frmAssent_11").SwfTable("swfname:=ugMns").GetCellAppearance(2,2,appForeColor) Above Code throwing an error : Object doesn't support this property or method: 'GetCellAppearance'
Above code returning as R=0, G=0, B=0
The Scenario is UltraGrid Cells having Static Text, which colors will be change dynamically (if check box is checked color turned to Yellow and if we Unchecked color turned to Black).
Please let us know if anything additional information required from my side?
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.
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?
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:
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.