Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting from WinRunner - command line executable
#1
Not Solved
We are implementing/converting from QTP from WinRunner and below is how we ran cleanup scripts (oracle) in WR:

invoke_application("ExportCleanup.cmd","user password database","K:\\Database_Cleanup_Scripts\\",SW_HIDE);

I was looking for an equivalent in QTP - so we don't have to redo totally everything... I have this that works so far, but it 1) doesn't use what we already have, 2) doesn't scale well for some cleanup scripts that are 20-30 lines long...

Code:
Sub DBCleanup(KScriptName, DSN, uName, uPwd)
    Set objConn=CreateObject("ADODB.connection")
    objConn.Open "Data Source=" & DSN & ";User ID=" & uName & ";Password=" & uPwd & ";LSProvider=ODP;"
    objConn.Execute KScriptName
    objConn.Execute "commit"
    Set objConn = Nothing
End Sub


I tried the wscript.shell object and didn't get any errors, but the data was not removed from the database properly:

Code:
Sub Test
    Set objShell=CreateObject("wscript.shell")
    'command to Execute
    strCommand="K:/Database_Cleanup_Scripts/ExportCleanupXI.cmd user pwd server"
             Set objExec=objShell.Exec(strCommand)
End Sub

Any ideas?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to catch the script execution when QTP scripts are executed from command line Sreeni.lutukurthy 0 2,686 03-19-2015, 05:55 PM
Last Post: Sreeni.lutukurthy
Wink How to read text in command prompt using QTP Sourabh146 1 6,347 11-30-2013, 11:02 AM
Last Post: ravi.gajul
  Can any of the line in notepad file be appended/updated/modified via QTP(VBScript)? rookie_automator 1 2,418 08-22-2013, 07:13 AM
Last Post: basanth27
  Clicking command button in accesss form mark_cielos24@yahoo.com 1 3,169 05-07-2013, 10:52 PM
Last Post: agarwl.anurag
  How to draw a line using QTP descriptive script? brijith04 2 3,483 03-11-2013, 07:01 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)