Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripts stops after performing a step when it has been initiated by schedule task.
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Code:
Function fFindLatestBuilt ()

          SystemUtil.Run "\\Ausydw2342\BUILDS\MP2.50","","\\Ausydw2342\BUILDS\MP2.50",""
        Window("MP2.50").Activate
        rCount = Window("MP2.50").WinListView("SysListView32").GetItemsCount

rCount = rCount -1
[b]BuiltNo = Window("MP2.50").WinListView("SysListView32").GetItem (rCount)[/b]
Dim fso6
            Set fso6 = CreateObject("Scripting.FileSystemObject")
        

If (fso6.FileExists ("\\Ausydw2342\BUILDS\MP2.50\"&BuiltNo&"\Setup\DISK1\Setup.exe")) Then
  
                        Datatable.Import ("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt")
                        PBNo = DataTable.GetSheet("Global").GetParameter("BNo").ValueByRow(1)
'                        msgbox PBNo
'                        msgbox BuiltNo
        If strComp (PBNo, BuiltNo) = True Then
                        Dim fso5, MyFile
                        Set fso5 = CreateObject("Scripting.FileSystemObject")
                        Set MyFile = fso5.CreateTextFile("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt", True)
                        MyFile.WriteLine("BNo")
                        MyFile.Write (BuiltNo)
                        MyFile.Close
                        Datatable.Import ("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt")
                        
                        
                      s = 1
                        fFindLatestBuilt = s
                        Reporter.ReportEvent micPass, "SiPass Installation Version available and used is: MP2.50\MP2.50."&bno&".00"&b&""&a, "This should be the latest availble SiPass Inte folder in the SiPass 2.50 directory"
Else
Reporter.ReportEvent micWarning , "SiPass Integrated nightly built is not available" , "Please contact the developers "  
        End if

    
'        s = 0
'         fFindLatestBuilt = s
''msgbox "A"
        
    
End if
End Function


'***********************************************************

Code:
Sub sRemoveSiPassInteg()

Dim fso1, msg
    Set fso1 = CreateObject("Scripting.FileSystemObject")
If (fso1.FileExists("D:\Program Files\SiPass Integrated\SiPass.exe")) Then

    If Window("SiPass Integrated").Exist Then
    
            Window("SiPass Integrated").Activate
    
    End If

           Datatable.Import ("\\Ausyddata02\testing\QTP Common\Lab Tests\DATA Files\LastBuiltNo.txt")

        BNo = DataTable.GetSheet("Global").GetParameter("BNo").ValueByRow(1)

                SystemUtil.Run "\\Ausydw2342\BUILDS\MP2.50\"&bno&"\Setup\DISK1\Setup.exe"

                    While Window("SiPass integrated Setup").Exist = False
                    
                    Wend
                    
                    While  Window("SiPass integrated Setup").WinRadioButton("Remove").Exist = false
                    
                    Wend
                    
        [b]Window("SiPass integrated Setup").WinRadioButton("Remove").Set[/b]
                    
        Window("SiPass integrated Setup").WinButton("Next >").Click
                    
        Window("SiPass integrated Uninstall").WinButton("Next >").Click

                    
                    While Window("SiPass integrated Setup").WinButton("Finish").Exist = False
                    
                    Wend

        Window("SiPass integrated Setup").WinButton("Finish").Click
        Reporter.ReportEvent micPass, "SiPass Version Installed was: MP"&BNo, "SiPass "&BNo&" is successfully removed from this PC"
        
                    Dim fso2
                    Set fso2 = CreateObject("Scripting.FileSystemObject")
                       fso2.DeleteFolder("D:\Program Files\SiPass Integrated")
       
                  
Else

                    Dim fso3
                    Set fso3 = CreateObject("Scripting.FileSystemObject")
                    
                    If (fso3.FolderExists("D:\Program Files\SiPass Integrated")) then
                
                                    Dim fso4
                                    Set fso4 = CreateObject("Scripting.FileSystemObject")
                                    fso4.DeleteFolder("D:\Program Files\SiPass Integrated")
                        
                     End If
                    
                      
End If

End Sub

i am calling these two functions in my script from another .vbs file.
There are two conditions:
1. Sometimes it runs and stops at first "bold line
2. Sometimes it runs upto second bold line and hung

If i run this script manually (without Schedule task) its ok.

I dont know whats wrong with it.

Thanks,

Ajit
Reply


Messages In This Thread
RE:Scripts stops after performing a step when it has been initiated by schedule task. - by Ajit.2k6 - 03-08-2010, 10:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP - each step screenshot bitmap in to word balamurali 0 2,280 02-07-2018, 10:06 PM
Last Post: balamurali
  [ QC& QTP] issue with Qc design step parameter seritalien 0 1,925 05-29-2013, 06:56 PM
Last Post: seritalien
  QTP stops execution with no error vinod_3466 0 2,317 04-24-2013, 01:36 PM
Last Post: vinod_3466
  Hyderabad Schedule Drive for QTP Experts 3-7yrs supputuri 0 1,758 02-11-2013, 03:26 PM
Last Post: supputuri
  Schedule test set run using OTA baluonline 0 3,690 11-17-2012, 02:44 AM
Last Post: baluonline

Forum Jump:


Users browsing this thread: 5 Guest(s)