Click method not actually clicking on item
I am attempting to run through a footer which has 32 links that are all identified in TC as "....Link(0) through ...Link(32)". I have a loop that is supposed to sequentially click each one. It clicks the first one fine, but the second creates an error as it's not actually clicking on the item it says it is (see image attached). I have used "SetFocus" and I have forced a wait of up to 10 seconds after the item has already appeared on the screen and it still creates this error. I'd appreciate any help.
function Swagbucks(theLink,browser,env)
{
try
{
Delay(2500)
Sys.Keys("[PageDown][PageDown][PageDown][PageDown]")
for(i=1;i<21;i++)
{footerLink=theLink.Panel("sbFooterWrap").Panel("sbFooterContainer").Panel("sbFooter")
if(footerLink.Link(i).Exists==true)
{
if(i>1){Sys.Keys("[PageDown][PageDown][PageDown][PageDown]")}
theText=footerLink.Link(i).contentText+" footer link."
Delay(10000)
footerLink.Link(i).SetFocus()
footerLink.Link(i).Click()
Log.Message(theText)
Delay(2500)
}
else
{Log.Warning("Link was not visible on screen for selection.")
continue}
switch(i)
{
...
default:
theLink.Keys("[BS]")
Delay(2500)
continue
}
}}
catch(e)
{Log.Error("Failed Swagbucks Footer Column.")}
}