Forum Discussion

RussH's avatar
RussH
New Contributor
5 years ago

Parsing HTML table is quick, but clicking a found item is delayed by 5+ minutes.

Greetings.

 

I am working with dynamic content found within an html table (results of views, searches, etc...).  When modifying the example code found here:

https://support.smartbear.com/testcomplete/docs/app-testing/web/general/examples/parsing-html-tables.html

 

When I find the record I'm looking for, I can break out of the loop and return a specific cell's value for validation quickly and easily.  However, if I attempt to double click the cell or click on an edit link within the cell (both open the crud screen for the record), it takes 5+ minutes for the action to be performed.  When performed, it does what it is supposed to do and opens the crud screen.

 

i've tried using the the loop variable "cell" to perform the action against.

 

Thinking it might be a problem with how the tables are parsed, I've also tried using the FindChild method to click on the elements, but I get the same delay.

 

There is no delay if I actually have the object NameMapped / Aliased, but that defeats the purpose of testing dynamic content for data driven tests.

 

Any help would be appreciated.  Sanitized sample code below:

 

function openRecord(recordName){
var recordTable = Aliases.browser.somePage.someTable

Log.AppendFolder("Table");
for (var i = 0; i < recordTable.RowCount; i++){
Log.AppendFolder("Row " + i);

var cellName = recordTable.Cell(i, 2); //Cheating here using a specific column index.
Log.Message("cellName: " + cellName.innerText);
//Some code to remove embedded html nbsp
if(aqString.Compare(CommonUtils.removeNBSP(cellName.innerText), recordName, false) == 0){
Log.Message("FOUND IT!");
// This double click takes 5 minutes!
cellName.DblClick();
break;
}
Log.PopLogFolder();
}
Log.PopLogFolder();
}

 

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Well, here's the question...  do you need to double click on the cell?  Or do you need to double click on some component in the content of the cell?  I'm guessing the latter?  In which case, once you find the cell you're looking for, perhaps you should do something like

     

    var control = cellName.FindChild('ObjectType', 'link', 1)

    if (control.Exists) control.DblClick()

    • RussH's avatar
      RussH
      New Contributor

      Thanks for the response Robert,

       

      I have the option to double click the row (or cells within the row) or single click the link within a particular cell.  All give the same result.  I actually did try your recommendation before with several different variations of the cell and the link within the cell.  Sorry, I wasn't explicit about that when mentioning the use of the findChild method.

       

      Just to be sure, I gave it another shot (your example was more concise than mine).  Sadly, I get the same delayed action.  I threw in a log message before clicking the control - it found it right away.

       

      Russ

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        OK... then it sounds like a caching thing.  That while it may be looping through, there may be something else that's needed to actually select the object.  Try a RefreshMapping Info on the table object before doing the click.