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
Solved! Go to Solution.
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
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.
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
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?
Normal run mode:
I have an object called frmPSBadgerOK
Mapped name: Aliases.PSBadgerProject.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
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
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.
I read all the SmartBear stuff about environment settings for using the RunAs mode and these are all correct
I meant what language is the application you are testing written in. That's what determines how TestComplete identifies objects.
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