我阅读了有关用户扩展和扩展 selenium的信息,但想知道如何从我正在创建的自定义命令中调用命令。
我在 Selenium IDE Options 中的 Selenium core extensions (user-extensions.js) 中添加了一个类似如下的文件。
// selenium-action-example.js
Selenium.prototype.doExample = function() {
this.doOpen("/"); // doesn't waitForPageToLoad like the command does
// These two commands are equivalent to the clickAndWait command. NOT!
// For proof, see the filterForRemoteControl function:
// http://code.google.com/p/selenium/source/browse/trunk/ide/src/extension/content/formats/formatCommandOnlyAdapter.js?r=8284#68
this.doClick("css=a#example");
this.doWaitForPageToLoad(); // doesn't wait at all
this.doClick("link=Example");
this.doWaitForElementPresent("example"); // error! undefined function
this.doClick("example");
};
换句话说,我如何在自定义操作中等待点击之间的事情?