Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble with For loop
#1
Solved: 10 Years, 9 Months ago
When the inner for loop is over the controls are passing to the next higher for loop but gets stuck in the first statement of the outer for loop saying the parameter is incorrect.
Here is the code I am using
Code:
For i = 1 To 4  ---- When the inner loop is complete the next value in ---------the datatable is not retrieved and the error pops up 'parameter --------incorrect'
Browser("x").Page("y").WebRadioGroup("RB").Select DataTable("RB", dtGlobalSheet)
For j = 1 To 8 ---- This loop executes perfectly
[statements]
next
next

Any ideas pleaseSad
Reply
#2
Solved: 10 Years, 9 Months ago
Hi Mala,

Your are using datatable in for loop and fetching data from it. Is your data in different rows and are you using DataTable.SetCurrentRow(parameter)?
If so, then use datatable.setcurrentRow(i) as first statement of your outer for loop.

Please let me know if this is not the case. Also please share the complete piece of code if possible.
Reply
#3
Solved: 10 Years, 9 Months ago
Thanks Manish,
I was using DataTable.GetSheet(dtGlobalSheet).SetCurrentRow but then changed to DataTable.GetSheet(dtGlobalSheet).SetCurrentRow(i) later and got the results. However I had to make changes to the inner loop also the same way and made it DataTable.GetSheet(dtGlobalSheet).SetCurrentRow(j). Now it works fine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trouble Getting UFT to Work with Simplified Chinese hhamilton 2 2,752 03-10-2016, 09:35 AM
Last Post: vinod123
  FOR LOOP shayk1985 1 5,119 12-13-2012, 11:35 AM
Last Post: sams001
  How to exit from a for loop silpavinod 2 9,369 10-17-2012, 12:55 AM
Last Post: agarwl.anurag
  for loop sia sharma 1 3,196 09-13-2012, 11:44 AM
Last Post: ksrikanth2k9
  Help with Loop LJENNE 1 3,050 08-10-2012, 12:32 PM
Last Post: Ankesh

Forum Jump:


Users browsing this thread: 1 Guest(s)