Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why will this work only sometimes
#1
I have a piece of code that loops. It will run a number of times (sometimes 3, sometimes 7) and then suddenly stops and errors that an object cannot be found. I am wondering why and if you have any suggestions to fix.

The code errors out on the htm fn... line

Here is the code:

foreach cell table.cells
sel counter
case 1
0.5
out acount
fp[acount]=cell.innerText
counter=counter+1
Htm fpb=htm("TD" fp[acount] "" "Internet Explorer" "2/3" 0 0x21)
fpb.Click
wait 0 I
0.75
Htm fn=htm("INPUT" "txtFirstName" "" "Internet Explorer" "2/4" 16 0x121)
str fnt=fn.Text
Htm ln=htm("INPUT" "txtLastName" "" "Internet Explorer" "2/4" 19 0x121)
str lnt=ln.Text
al[acount].from(fnt " " lnt)
indate[acount]=""
case 2


As always, thanks for your help.
#2
Suggestion:

Htm fn=htm("INPUT" "txtFirstName" "" "Internet Explorer" "2/4" 16 0x121 15)

Will wait max 15 s for the element.


Forum Jump:


Users browsing this thread: 1 Guest(s)