Forum Discussion

vthomeschoolmom's avatar
Super Contributor
5 years ago

Really TR not supported in Firefox and Chrome? Do I understand this correctly

Consider this code:   // Select desired cell. If not already selected, click it. (If // it is already selected do not click as clicking will de-select.) // Row objects are not present for FF and Ch...
  • TanyaYatskovska's avatar
    5 years ago

    Hi vthomeschoolmom,


    I see that you are working with the Support team on this question. Let me post their reply here:

    Hi Stephanie,

    Thank you for creating this case. In TestComplete, you can access the HTML DOM document object of web pages, by using the contentDocument property of the page. You can also use contentDocument.Script property of the page to execute scrips on web pages. 

    To obtain the class of a TR tag in Chrome/Firefox, you can utilize the JavaScript method(s): querySelector or getElementsByClassName to obtain the TR tag object and then locate the className property afterwards. See below for a sample TestComplete script:

    function queryTR() {
      var page = Sys.Browser("chrome").Page("*");
      var className = page.contentDocument.Script.eval('document.getElementsByClassName("parent")[0].children[0].children[1].className');

    Refer to the following documentation regarding running JavaScript on web pages using TestComplete: 

    Executing JavaScript on Web Pages: 
    Accessing DOM document Object:

    Let me know if you have any questions.