Forum Discussion

misbah_akbari's avatar
misbah_akbari
Frequent Visitor
6 years ago

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

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    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.