1716 | def wait_for_condition(self,script,timeout): |
1717 | """ |
1718 | Runs the specified JavaScript snippet repeatedly until it evaluates to "true". |
1719 | The snippet may have multiple lines, but only the result of the last line |
1720 | will be considered. |
1721 | |
1722 | |
1723 | Note that, by default, the snippet will be run in the runner's test window, not in the window |
1724 | of your application. To get the window of your application, you can use |
1725 | the JavaScript snippet ``selenium.browserbot.getCurrentWindow()``, and then |
1726 | run your JavaScript in there |
1727 | |
1728 | |
1729 | 'script' is the JavaScript snippet to run |
1730 | 'timeout' is a timeout in milliseconds, after which this command will return with an error |
1731 | """ |
1732 | self.do_command("waitForCondition", [script,timeout,]) |