Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statement
#1
Solved: 10 Years, 9 Months, 2 Weeks ago
Dear All,
I add this to my QTP scripts.
I don't know why the value the i would added up to 6 after the first iteration in the while loop.
I am really confused.
The value of i equal to 0 and after running in the first iteration in the while loop, it should become 1 instead of 6.

As I am now in QTP and VB, please help!


Code:
Dim i , field
i = 0
field = "Basic Work Time"
While  i<6
SiebApplication("Siebel Energy (CMS DR)").SiebScreen("Appointment Booking").SiebView("TG Appointment Booking").SiebApplet("Audit Trail Items").SiebButton("Query").Click
SiebApplication("Siebel Energy (CMS DR)").SiebScreen("Appointment Booking").SiebView("TG Appointment Booking").SiebApplet("Audit Trail Items").SiebText("Field").SetText field
SiebApplication("Siebel Energy (CMS DR)").SiebScreen("Appointment Booking").SiebView("TG Appointment Booking").SiebApplet("Audit Trail Items").SiebButton("Go").Click
If i = 0 Then
     i = 1
     field = "Contractor Labour Rate"
end if
If i = 1 Then
     i = 2
    field = "Quota"
end if
If i = 2 Then
     i = 3
    field = "Message Print Location"
   end if
If i = 3 Then
     i = 4
   field = "Order Print Location"
   end if
If i = 4 Then
     i = 5
    field = "SAP Print Location"
end if
If i = 5 Then
     i = 6
      field ="Store Location"
end If
Wend



Thanks
Jody
Reply


Messages In This Thread
If statement - by yuetling926 - 10-16-2009, 09:50 AM
RE: If statement - by Saket - 10-16-2009, 10:26 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)