cancel
Showing results for 
Search instead for 
Did you mean: 

'process not accessible' error

Adagio
Frequent Contributor

'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 3
tristaanogre
Community Hero

Re: 'process not accessible' error

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Adagio
Frequent Contributor

Re: 'process not accessible' error

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
Community Hero

Re: 'process not accessible' error

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors