| || |
Access to Ms Flex grid in TestComplete 5
I have to test Web site.
I test it with help of TestComplete 5ent.
I have faced with problem of getting properties of MS Flex grid which is inserted on webpage as ActiveX object.
I have read about such problem on the forum and did not find an answer:
I use next function:
var w, ColIdx, i, s;
w = Sys.Process("iexplore").
Window("IEFrame", "http://184.108.40.206 - HOM1 - Sagitta Home Page - Microsoft Internet Explorer", 1).
Window("Shell DocObject View", "", 1).
Window("Internet Explorer_Server", "", 1).
Window("ThunderRT6UserControlDC", "", 1).
Window("MSFlexGridWndClass", "", 1); //This is my Flex grid which I need to access to;
// Search for the column index
ColIdx = -1;
for (i = 0; i < w.Cols; i++) // Here script fails because w.Cols in null or not an object;
if ( w.TextMatrix(0, i) == ColumnName)
ColIdx = i;
// If the column was not found...
if (ColIdx == -1)
// Post warning to the test log
Log.Warning("Column '" + ColumnName + "' was not found.");
// Retrieve data from the column cells
for (i = 1; i < w.Rows; i++)
s = w.TextMatrix(i, ColIdx);
How can I get the properties of the grid?
How can I convert Window("MSFlexGridWndClass", "", 1) to object which supports grid properties?
I need your help!
Re: Access to Ms Flex grid in TestComplete 5
You need to obtain the web page element that corresponds to the grid. Once you do this, you will be able to access the grid's native properties and methods via its 'object' property.
<font class="small">Code:</font><hr /><pre>...
var page = // Obtain the page
var grid = page.document.all.Item("MSFlexGrid1");
var cellText = grid.object.TextMatrix(0, 0);