Micro Focus QTP (UFT) Forums
Restart the script in qtp - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Restart the script in qtp (/Thread-Restart-the-script-in-qtp)



Restart the script in qtp - arpan - 06-24-2013

Hi Guys,
Below is the my sample script:
Code:
‘Look for .txt file
Set fso = CreateObject("Scripting.FileSystemObject")
s1=fso.FileExists("C:\temp\Test_Config.txt")
do While s1 <> "True"
      Wait(20)
    s1=fso.FileExists("C:\temp\Test_Config.txt")
Loop
‘Read from the file
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
    s2="C:\temp\SmokeTest_Config.txt"
   Set theFile = fso.OpenTextFile(s2, ForReading, False)
   Do While theFile.AtEndOfLine <> True
      retstring = theFile.ReadLine
      Loop
   theFile.Close

URL ="http://google.com/"
userName ="xyz"

Call Website()
'Call Login ()

Function Website()
Script
End Function

Function Login ()
Script
End Function

Script to delete the txt file

How can i restart the script using loop?


RE: Restart the script in qtp - arpan - 06-24-2013

Never mind everybody. Found the solution. I'm doing loop in vbs script that i'm using for schedular.

Thanks for looking into the problem.