Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
How to retrieve the row color from WbfGrid


I am automating .NET web application using UFT14.03 and TA15.02. Tried with retrieving the row color of WbfGrid with below code but did not get expected row color (blue).


msgbox Browser("ServiceNow").Page("Provider Availability").WbfGrid("G_ctl00xContentPlaceHolder1xug").Object.rows(3).cells(1).currentStyle.backgroundColor

msgbox Browser("ServiceNow").Page("Provider Availability").WbfGrid("G_ctl00xContentPlaceHolder1xug").Object.rows.item(2).scurrentStyle.backgroundColor

Developer source code:

row.Style.BackColor = System.Drawing.Color.Blue;

Please let me know how to retrieve the row color from WbfGrid?



Parents Reply
  • 26785
    Offline posted in reply to Awati Guru

    Hello Awati, 

    After looking at MicroFocus' website, a WbfGrid object is a .NET Web Forms DataGrid object. This means you are not testing using a Windows Forms control because none of our windows forms or wpf controls derive from a DataGrid. Test Advantage for Windows Forms won't help here and is only compatible with Windows Forms applications, not web apps.

    I recommend contacting MicroFocus's support for help:


    If you do plan on testing a Windows Forms application with our controls; we have one grid control in our Windows Forms tools suite called UltraGrid. 

    eg. A line in a script for an UltraGrid would look something like this:


    I strongly encourage you to visit our Test Automation landing page for more details about our products:

    Test Advantage (Test Automation for UFT) has two offerings and is compatible with desktop applications only. (eg. Infragistics Windows Forms and WPF).

    Let me know if you have any questions.