'Launch the application of MyApplication.Bat
Function FuncLaunchMyApplication(AppName,AppDirectory)
Dim oShell
Set oShell=CreateObject("Wscript.Shell")
oShell.Run("cmd.exe")
Wait 2
oShell.AppActivate "cmd.exe"
oShell.SendKeys "cd "&AppDirectory
oShell.SendKeys "{ENTER}"
Wait 1
oShell.SendKeys "MyApplication.bat"
oShell.SendKeys "{ENTER}"
oShell.SendKeys "Exit"
oShell.SendKeys "{ENTER}"
Set oShell=Nothing
End Function
''This function login to application using one of the TestID
Function FuncAppNameLogin_TestID(TestingUserid,TestingPassword)
If JavaDialog("AppName").Exist(10) Then
JavaDialog("AppName").JavaEdit("User ID").Set TestingUserid
JavaDialog("AppName").JavaEdit("Password").SetSecure TestingPassword
JavaDialog("AppName").JavaButton("Login").Click
SubCloseWindowMessages
If JavaWindow("AppName - Global").Exist(30) Then
FuncAppNameLogin_TestID=True
ElseIF JavaDialog("AppName").JavaDialog("LOGON").Exist(10) Then
JavaDialog("AppName").JavaDialog("LOGON").JavaButton("OK").Click
JavaDialog("AppName").JavaButton("Close").Click
FuncAppNameLogin_TestID=False
Else
FuncAppNameLogin_TestID=False
End If
Else
FuncAppNameLogin_TestID=False
End If
End Function
Hope this could work with your BAT File.where AppName is your Complete
BatFile name and AppDirectory is the Path of the Application.
Regards,
Prasad
On Thu, Jan 15, 2015 at 2:33 AM, emi.priyadharsini <[email protected]>
wrote:
> Hi ,
>
> As per my process i need to run a Batch file. Once it gets run a new
> window will display as a output. In that window we have to give user name
> and Password.
>
> But when i run the Batch File, it is running and getting closed
> immediately. Batch File is not running fully. So the new window where we
> have to give user name and password is not opening
>
> Can anyone help me to run Batch file fully.
>
> Thanks,
> Emi
>
> --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.