Thursday, 25 September 2014

Vb Script For How To Stop QTP while Running or Executing?

'Need to Stop Running or Iteration while i=5

Option Explicit
Dim i,a,qaapp,aTest
qapp()
app()

Function qapp()
Set qaapp=CreateObject ("QuickTest.Application")
qaapp.launch
qaapp.visible=True
End Function

Function app()
For i=1 to 10
 a= "Test1" & i
SystemUtil.Run "iexplore.exe","http://www.google.com",,,3/
Browser("Google").Page("Google").WebEdit("q").Set a
Browser("Google").Page("Google").WebButton("Google Search").Click
Browser("Google").Close

Set aTest=qaapp.Test
If i=5  Then
 aTest.Settings.Run="Stop"
End If

Next
End Function

No comments:

Post a Comment