Forum Discussion

Adagio's avatar
Adagio
Frequent Contributor
7 years ago

'process not accessible' error

Hello,

 

I'm trying to read the text in a column of a table using the following, but I keep getting 'Process Not Accessible' error.

what's could be the reason and what's this related to? any help would be appreciated.

 

 

 

 

 

 

function getRowIndex(){

      if(dataTable.Cell(0, 1).Exists){
      for(var i = 0; i < dataTable.RowCount ; i ++){
          Log.Message("Total rows in the table: " +dataTable.RowCount);
          dataTable.Cell(i, 2).TextNode("locnClass").scrollIntoViewIfNeeded();
        if(equal(dataTable.Cell(i, 2).TextNode("locnClass"), "Match")){  
            return i;
        } 
      
       } 
       return false;
   } else{
     
      return false;
   } 
        
} 

Thank you

Abhi

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Well, first of all, not sure why you're using "equal" rather than actually using a boolean expression.

     

    Secondly, you're comparing an object to a string... so they will actually not compare anyways.

     

    So... the line you have bolded, I'd actually change to something like

     

    if(dataTable.Cell(i, 2).TextNode("locnClass").text === "Match"){  
                return i;
    }

    Assuming "text" is a property on that TextNode which will contain the text which might actually have the word "Match" in it.

    • Adagio's avatar
      Adagio
      Frequent Contributor

      Thanks for looking into this, Robert!

       

      I think, by mistake I removed the property of the textNote. textContent is what I'm using.

       

      if(dataTable.Cell(i, 2).TextNode("locnClass").textContent === "Active")

      For the string comparison, I use the 'equal' operator as suggested on TestComplete site.  but I changed it to what you've suggested. But, I still see this issue of "Process Not Accessible". Please let me know if there's anything else that I'm not doing correctly here.

       

      JavaScript equality operations, == and ===, may lead to incorrect results when comparing values obtained from:
      
      Objects in a tested application,
      TestComplete scripting objects (such as aqEnvironment),
      COM objects.
      For example (but not limited to), when comparing these values to null, undefined or objects.
      
      To avoid issues, use the equal() and strictEqual() functions instead of == and ===.

      Thank you

      Abhi

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        You're comparing strings, not objects of any of those varieties.  So, the == and === booleans should work.

         

        Are you getting the "Process not accessible" on that line itself or is there some other execution that's causing this?

         

        I don't see in your original post where dataTable is being declared and assigned.  Is it possible that the problem is not in the code you have posted but in something earlier on that is attempting to identify dataTable?

         

        Something else... I've done a quick querty on "scrollIntoViewIfNeeded" and it appears to be a proprietary implementation of "scrollIntoView".  I'm curious if this is what might be causeing the problem.  Try replacing that with "scrollIntoView(true)" and see if that resolves it.... it might be that the other method is not supported by the browser you're using for your test execution.