Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my Selenium command not work?

I'm writing a selenium script that should only start testing after all ajax calls have completed.

Several forums have suggested that I use the following condition (in the waitForCondition command):

selenium.browserbot.getCurrentWindow().jQuery.active == 0

Unfortunately this keeps throwing an error:

jQuery is undefined

JQuery is definitely defined on my site. I have also tried substituting the jQuery with $, but get the same error.

Any ideas?

like image 413
willem Avatar asked Jun 01 '26 22:06

willem


1 Answers

You might need to wait for jQuery to have finished loading, try waiting until

typeof selenium.browserbot.getCurrentWindow().jQuery == 'function'

is true, before checking active.

like image 112
artbristol Avatar answered Jun 03 '26 19:06

artbristol