cancel
Showing results for 
Search instead for 
Did you mean: 

Test Complete does not recognizes the application if the application is launched in win7 through cmd

Frequent Visitor

Test Complete does not recognizes the application if the application is launched in win7 through cmd

Hi

 

Test Complete does not recognise application when application is launched through command prompt in win 7

but it recognizes application and objects when the same application is launched through command prompt in win 10

 

If Instr(OS_VERSION, "Microsoft Windows 10") <> 0 then

Set objShell = CreateObject("WScript.Shell")
Set objEnv = objShell.Environment("Process")
WinPath = objEnv("SystemRoot") & "\System32\runas.exe"

'TestUser access information.
domain = Sys.HostName
AppExePath = "C:\Program Files\App.exe"

Call objShell.Run("runas /user:" & domain & "\" & user & " " & aqString.Quote(AppExePath ), 1, FALSE)
Call Sys.WaitProcess("runas", 5000)
objShell.AppActivate(WinPath)
Call objShell.SendKeys(password & chr(13))

1 REPLY 1
Community Hero

Re: Test Complete does not recognizes the application if the application is launched in win7 through

Question:

Why are you sending your keystrokes to the objShell?  That seems a rather round about way to enter commands to the application under test, given that TestComplete can interact directly with most applications.


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
New Here?
Join us and watch the welcome video: