VB script for retrieving logs
Hi Guys,
I know this is going to be a long message... [8D]
Im a software tester, and im working on automating certain procedures which i am doing manually and routinely... Its quite complicated for some to understand... but please guys,,, I BADLY NEED YOUR HELP...
My work is dealing with testing of BANKING applications... and My scenario is this...
I have an application (Datastage Director), which has the logs (status) for all the functions i perform (for ex:if i trigger a job,,, then.. whether the job has run successfully or not. And if not, what is the reason for "Failure" status of the job, and whether ouput file has been successfully transferred to Target system..., etc.. )
Basic intro to Datastage Director: The application will have lot of folders ( each one corresponds to one application ) and in a folder there will be a list of processes.
Manual way : I usually access the application with my credentials and then go to the specific folder (i.e, the application which i work), and then right click on a process. When i right click it, there will be many options and i have to select 'view logs' and i get the logs.... [&o] and i have to do for all the processess which are in a folder.. be it 1 or 10 (which is the max)... [:)]
So... I need a Script ,, which would ask me the "Folder Name" and when i give it,,, it must go to it and select the process and retrieve the logs in a notepad.
Guys i have some scripts,,, which i surfed in net and got (im novice in programming)..
Opening an application:
Sub Run(ByVal sFile)
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub
Run "C:\Program Files\Windows Media Player\wmplayer.exe"
Closing an application:
Set objShell = CreateObject("WScript.Shell")
Set objWmi = GetObject("winmgmts:")
strWmiq = "select * from Win32_Process where name='wmplayer.exe'"
Set objQResult = objWmi.Execquery(strWmiq)
For Each objProcess In objQResult
intRet = objProcess.Terminate(1)
Next
The above two can be used for opening and closing datastage director application. (but i dont know to integrate them into a single script though.. [>:][X(])
Guys and i also, have seen multiple posts in this section relating to copy files,, and searching a folder etc...
And Sendkeys can be used for RIGHT CLICK s that we have to use,,,
Hope its somewhat helpful to you.
GUYS,, please find me a solution and if i find one... ill def share it soon... [:)]
I know this is going to be a long message... [8D]
Im a software tester, and im working on automating certain procedures which i am doing manually and routinely... Its quite complicated for some to understand... but please guys,,, I BADLY NEED YOUR HELP...
My work is dealing with testing of BANKING applications... and My scenario is this...
I have an application (Datastage Director), which has the logs (status) for all the functions i perform (for ex:if i trigger a job,,, then.. whether the job has run successfully or not. And if not, what is the reason for "Failure" status of the job, and whether ouput file has been successfully transferred to Target system..., etc.. )
Basic intro to Datastage Director: The application will have lot of folders ( each one corresponds to one application ) and in a folder there will be a list of processes.
Manual way : I usually access the application with my credentials and then go to the specific folder (i.e, the application which i work), and then right click on a process. When i right click it, there will be many options and i have to select 'view logs' and i get the logs.... [&o] and i have to do for all the processess which are in a folder.. be it 1 or 10 (which is the max)... [:)]
So... I need a Script ,, which would ask me the "Folder Name" and when i give it,,, it must go to it and select the process and retrieve the logs in a notepad.
Guys i have some scripts,,, which i surfed in net and got (im novice in programming)..
Opening an application:
Sub Run(ByVal sFile)
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub
Run "C:\Program Files\Windows Media Player\wmplayer.exe"
Closing an application:
Set objShell = CreateObject("WScript.Shell")
Set objWmi = GetObject("winmgmts:")
strWmiq = "select * from Win32_Process where name='wmplayer.exe'"
Set objQResult = objWmi.Execquery(strWmiq)
For Each objProcess In objQResult
intRet = objProcess.Terminate(1)
Next
The above two can be used for opening and closing datastage director application. (but i dont know to integrate them into a single script though.. [>:][X(])
Guys and i also, have seen multiple posts in this section relating to copy files,, and searching a folder etc...
And Sendkeys can be used for RIGHT CLICK s that we have to use,,,
Hope its somewhat helpful to you.
GUYS,, please find me a solution and if i find one... ill def share it soon... [:)]
0 Comments
[ + ] Show comments
Answers (5)
Please log in to answer
Posted by:
manosaran3
13 years ago
Posted by:
anonymous_9363
13 years ago
If my reading is correct, you're right-clicking in an application window. If that's correct, then what you're asking for is a huge undertaking. VBScript has no native handling for fetching screen co-ordinates of controls etc. so you'd need to investigate something like AutoIt. This will be not so much a learning curve as a learning cliff. Good luck!
Posted by:
pjgeutjens
13 years ago
doing some googling makes me think you'll need to write a script that calls consecutive dsjob commands. from what I gathered it seems dsjobs -ljobs will give you a list of jobs in the project, which could then be a basis for running a command against each of these. for running commands from VBS you'd use the Run method.
Let me stress though that I have no experience with DataStage Director, so this is a purely hypothetical suggestion...
PJ
Let me stress though that I have no experience with DataStage Director, so this is a purely hypothetical suggestion...
PJ
Posted by:
manosaran3
13 years ago
Thank You so much Guys for replying...
Let me start..
No VBScab... Im not right clicking on the Application.... Please view the image that im attaching... so that u can clearly get the picture of Datastage Director Screen.
When u see there... u have basically 2 divisions in the window. In the left pane ull see many folders... And i have to work in JOBS folder... I usually enter it by clicking on the "+" sign near it... it expands and displays all the folders present (just an ordinary process)... And now.. i usually select the folder which im working on...
For ex.. if im working in an extract named "ABC", then there would be a folder named "ABC" inside "JOBS" folder....Again i enter it by left clicking.... Then it would display many processes "EXACTLY AS U SEE IN THE RIGHT PANE OF THE MAIN WINDOW" in the attached image... [:)]
THIS IS WHERE MY REAL WORK IS... i have to right click on "ExecJob" and then select "view logs" option.. and it displays it... And again i have to do the same process for all the 6 processess present (like, Exec OraLoad... etc... etc... )
So our scope of Automation is... When i run the script... It must
Open the application --> Use my credentials to log in --> go to the JOBS folder --> go to ABC folder --> right click on processess and should select View Logs --> and Atlast must retrieve the logs in a notepad. [:-]
I HOPE THIS HELPS U GUYS TO UNDERSTAND MUCH BETTER...
And... I too know this is a tedious process,,, but it can really be achieved,,,
I ONCE AGAIN THANK ALL U GUYS FOR REPLYING ME AND FOR UR VALUABLE REPLIES... I TRULY RESPECT IT...
Cheers Guys,
Manoj.
Let me start..
No VBScab... Im not right clicking on the Application.... Please view the image that im attaching... so that u can clearly get the picture of Datastage Director Screen.
When u see there... u have basically 2 divisions in the window. In the left pane ull see many folders... And i have to work in JOBS folder... I usually enter it by clicking on the "+" sign near it... it expands and displays all the folders present (just an ordinary process)... And now.. i usually select the folder which im working on...
For ex.. if im working in an extract named "ABC", then there would be a folder named "ABC" inside "JOBS" folder....Again i enter it by left clicking.... Then it would display many processes "EXACTLY AS U SEE IN THE RIGHT PANE OF THE MAIN WINDOW" in the attached image... [:)]
THIS IS WHERE MY REAL WORK IS... i have to right click on "ExecJob" and then select "view logs" option.. and it displays it... And again i have to do the same process for all the 6 processess present (like, Exec OraLoad... etc... etc... )
So our scope of Automation is... When i run the script... It must
Open the application --> Use my credentials to log in --> go to the JOBS folder --> go to ABC folder --> right click on processess and should select View Logs --> and Atlast must retrieve the logs in a notepad. [:-]
I HOPE THIS HELPS U GUYS TO UNDERSTAND MUCH BETTER...
And... I too know this is a tedious process,,, but it can really be achieved,,,
I ONCE AGAIN THANK ALL U GUYS FOR REPLYING ME AND FOR UR VALUABLE REPLIES... I TRULY RESPECT IT...
Cheers Guys,
Manoj.
Posted by:
anonymous_9363
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.