Unable to find the object that matches the [object] item. when running an application in RunAs mode
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
Name Mapping
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
[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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
[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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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()
{
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
[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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code language is JavaScript
I read all the SmartBear stuff about environment settings for using the RunAs mode and these are all correct
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I meant what language is the application you are testing written in. That's what determines how TestComplete identifies objects.
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, the application is written in Delphi
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
