Murali Dhulipala
Murali Dhulipala

Reputation: 21

UFT Actions Issue

I am trying to parameterize the actions and below is the code which I had designed

Datatable.ImportSheet "Q:\Excel.xls","Sheet1","Action1"
a=datatable.GetSheet("Action1").GetRowCount
For i= 1 to a 
Datatable.GetShee("Action1").SetCurrentRow(i)
If datatable.Value("OracleDatabase","Action1")<>"" Then
    RunAction Datatable.Value("Scriptname","Action1"), oneIteration,"Oracle"
    msgbox  Datatable.Value("Scriptname","Action1")
End If 
If datatable.Value("SQLdatabase","Action1")<>"" Then 
    RunAction Datatable.Value("Scriptname","Action1"), oneIteration 
    msgbox Datatable.Value("Scriptname","Action1") 
End If 
RunAction "Action1 [MediumSanityWF12]", oneIteration 
Next

The problem here is, when I was running the above code , for the first iteration "Action1 [GUITest1]" is being executed and it is correct. In the second iteration, for oracle database,"Action1 [GUITest2]" script executed and for SQL database again "Action1 [GUITest1]" got executed. As per my understanding it should execute "Action1 [GUITest2]" action only as I used the setcurrentrow method of datatable. I little confused here why it is executing the "Action1" for SQL database instead of "Action2" in the second iteration?

Please make me clear on this.

Upvotes: 0

Views: 992

Answers (1)

Saikrishna
Saikrishna

Reputation: 108

I hope this should work

Datatable.ImportSheet "Q:\Excel.xls","Sheet1","Action1"
a=datatable.GetSheet("Action1").GetRowCount
For i= 1 to a 
Datatable.GetSheet("Action1").SetCurrentRow(i)
If datatable.Value("OracleDatabase","Action1")<>"" Then
    RunAction Datatable.Value("Scriptname","Action1"), oneIteration,"Oracle"

End If 
Datatable.GetSheet("Action1").SetCurrentRow(i)
If datatable.Value("SQLdatabase","Action1")<>"" Then 
    RunAction Datatable.Value("Scriptname","Action1"), oneIteration 

End If 
RunAction "Action1 [MediumSanityWF12]", oneIteration 
Next

Upvotes: 0

Related Questions