cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to find the object that matches the [object] item. when running an application in RunAs mode

SOLVED
Contributor

Unable to find the object that matches the [object] item. when running an application in RunAs mode

Hi,

 

When I run an application in normal 'Run' mode the application I'm running works consistently; however, when I run the application in 'RunAs' mode (I need to test authorisation functionality so need to run the application under a different user account) it doesn't recognise objects previously mapped and recorded in the NameMapping section. I've confirmed this using the object spy and analysing the name mapping

 

I'm at a loss as to how to fix this. I've tried all the suggestions that I can find including ensuring TC is run with administrator priviledges. I even 'RanAs' the same user currently logged into the machine with no success

 

Does anyone have any ideas as to what might me causing this

 

Thanks

 

Adam

1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

Hi,

 

Initially it worked when running the test through TestExecute from command line. I decided to launch TestComplete.exe directly from the application bin directory. This also worked.

 

The problem was running TestComplete from the desktop icon that was created during the installation process

View solution in original post

14 REPLIES 14
Community Hero

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

Does the application or objects change in any way with their properties?

What I would do is compare the properties with regular "Run" with properties of the objects with "Run as" and see where the differences are.  That's probably what's going on.


Robert Martin
[Community Expert Group]
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
Extensions available
Contributor

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

Thanks for your reply

 

The noticeable difference is the application launched in RunAs mode has a property of IsOpen = false, where as the application opened in 'Run' mode is set to true

Community Hero

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

It's not so much the application I was talking about... you mention that you have a problem finding an object... what properties change on that object that you're using in your mapping?


Robert Martin
[Community Expert Group]
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
Extensions available
Contributor

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

Normal run mode:

I have an object called frmPSBadgerOK

Mapped name: Aliases.PSBadgerProject.frmPSBadgerOK)

Name: VCLObject("frmPSBadgerOK")

 

This is a pop-up box that is displayed when the application completes it's processing. I then click the OK button.

 

With the 'RunAs' mode this changes to

MappedName: <Blank>

Name: Window("TfrmPSBadgerOK", "Confirm", 1)

 

I try to record a script to click the OK button but it returns an empty function, so it wasn't even able to record the test action

 

function test()

{

 

}

Community Hero

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

What code language is your application under test written in?  

Also... I wonder if it may be something where TestComplete is being run as an Administrator and the AUT is not and if that's causing issues.


Robert Martin
[Community Expert Group]
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
Extensions available
Contributor

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

The code language is JavaScript

 

I read all the SmartBear stuff about environment settings for using the RunAs mode and these are all correct

Community Hero

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

I meant what language is the application you are testing written in.  That's what determines how TestComplete identifies objects.


Robert Martin
[Community Expert Group]
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
Extensions available
Contributor

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

Sorry, the application is written in Delphi

Community Leader

Re: Unable to find the object that matches the [object] item. when running an application in RunAs m

It's a timing issue or temporary popup object creation issue.

Because it is a Delphi popup that has the confirm button that you are looking for.

Also it is very possible that the Delphi Developers pop the window using "TfrmPSBadgerOK.Create" instead of generating a persistent variable for the object, so the popup has a different temporary object name every time, so it breaks the name mapping and it is never found again.

 

If that is the case, you have to check the existance of the popup using the caption of the popup instead of the name of the object to get to it and click the confrm button.

 

Hope that makes sense

-Lino

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors