Saturday 29 August 2015

Run QTP action N number of times.

'' Action 1

SystemUtil.CloseProcessByName "iexplore.exe"
SystemUtil.Run "iexplore.exe", "gmail.com"
Environment("intIteration")=1
If Browser("creationTime:=0").exist(10) Then    
    Browser("creationTime:=0").Sync
End If
rCount= DataTable.GlobalSheet.GetRowCount
If rCount=0 OR Environment("intIteration")> rCount Then
    Reporter.ReportEvent micFail, "Import test data into data table", "Test data for test name: '"& Environment("TestName") & "' not found."
    ExitTest
End If
For i=1 to rCount
    DataTable.GlobalSheet.SetCurrentRow (i)
    If  i <= Environment("intIteration")  Then
        RunAction "testingAction1", oneIteration
        msgbox "Iteration: "& i & " of total: "& rCount
    End If      
'    If Environment("intIteration")=1 Then
'        Exit For    
'    End If      
Next

msgbox "done"

===============================
Action Name: testingAction1

Browser("creationTime:=0").Sync
Browser("creationTime:=0").Page("creationTime:=0").Sync
Browser("creationTime:=0").Page("creationTime:=0").Link("html tag:= A", "innerText:= More information").Highlight
Browser("creationTime:=0").Page("creationTime:=0").Link("html tag:= A", "innerText:= More information").Click
==================================================
"testingAction1" Propperties: -

No comments:

Post a Comment