Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for loop
#1
Solved: 10 Years, 9 Months, 2 Weeks ago
Hi All,

i have page which contains pagination.
and i want to search a particular category in the pages.
the logic goes link this
can i use 'for' or 'for each' instead of 'if'


Code:
A = Browser("abc").Page("pqr").Link("Pubs").GetROProperty("text")'If  A.Exist Then
function(call)
else
Browser("abc").Page("pqr").Link("2").Click
If  A.Exist Then
function(call)
else
Browser("abc").Page("pqr").Link("3").Click
If A.Exist Then
function(call)
else
Browser("abc").Page("pqr").Link("4").Click
If A.Exist Then
function(call)
else
Browser("abc").Page("pqr").Link("5").Click    
If  A.Exist Then
function(call)
else
Reporter.ReportEvent micFail,"invalid","category not found"
End if
End If
End If
End If
End If
Reply
#2
Solved: 10 Years, 9 Months, 2 Weeks ago
Code:
counter=0
for i=1 to 10
A = Browser("abc").Page("pqr").Link("Pubs").GetROProperty("text")
if A="some value" then
set obj= description.create
obj("micclass").value="Link"
obj("attached text").value=i
function(call)
counter=1
else
Browser("abc").Page("pqr").Link(obj).Click
end if
loop

if counter=0 then
Reporter.ReportEvent micFail,"invalid","category not found"
end if


it might help .....''
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  FOR LOOP shayk1985 1 5,132 12-13-2012, 11:35 AM
Last Post: sams001
  How to exit from a for loop silpavinod 2 9,413 10-17-2012, 12:55 AM
Last Post: agarwl.anurag
  Help with Loop LJENNE 1 3,069 08-10-2012, 12:32 PM
Last Post: Ankesh
  How to get out of infinite FOR loop... sssidana 3 4,405 07-20-2012, 01:04 AM
Last Post: sree.85
  Not able to Iterate using For Loop tanyamrz 2 3,204 05-22-2012, 09:41 PM
Last Post: tanyamrz

Forum Jump:


Users browsing this thread: 1 Guest(s)