selectWindow command error


#1

I am getting this error when I run the macro from exported html file:

  • [info]

Executing: | click | //*[@id=“form”]/div[5]/div[2]/div/div[2]/div/div[2]/table/tbody/tr[1]/td[2]/a/img | |

  • [info]

Executing: | waitForPageToLoad | | |

  • [info]

Executing: | selectWindow | tab=1 | |

  • [error]

Invocation of form tabs.get(null, function) doesn’t match definition tabs.get(integer tabId, function callback)

  • [info]

Macro failed (Runtime 5.53s)


#2

Does the macro work ok when you run it from within Kantu (= before exporting)?

And if the macro works on a public website, can you share it here (or email it to team AT a9t9.com if you do not want to post it here).


#3

A few things:

  1. If I run it from the browser it will work most of the time, but sometimes it will time out at the selectWindow tab=1 command which follows a click command of an image that kantu seems to be double clicking because it opens between 1-3 new tabs each time I run it.

  2. If I run it from a saved html file with the browser already open it will work 3/4 of the time but still throws the error listed above 1/4 of the time.

  3. If I run it from a saved html file without chrome being open it will always give the error listed in the orig post.

Here is the code from where it begins to fail. The click command is opening multiple tabs like it is being double or triple clicked so I put an extra selectWindow tab=1 command in there that seems to reduce the failure rate.

{
  "Command": "click",
  "Target": "//*[@id=\"form\"]/div[5]/div[2]/div/div[2]/div/div[2]/table/tbody/tr[1]/td[2]/a/img",
  "Value": ""
},
{
  "Command": "selectWindow",
  "Target": "tab=1",
  "Value": ""
},
{
  "Command": "selectWindow",
  "Target": "tab=1",
  "Value": ""
},
{
  "Command": "click",
  "Target": "link=My Name",
  "Value": ""
}

]
}