相关疑难解决方法(0)

扩展Selenium:如何调用命令?

我阅读了有关用户扩展扩展selenium但我想知道如何从我正在创建的自定义命令中调用命令.

我在Selenium IDE Options中向Selenium核心扩展(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");
};
Run Code Online (Sandbox Code Playgroud)

换句话说,我如何在自定义操作中的点击之间等待?

extension-methods selenium click selenium-ide selenium-rc

5
推荐指数
1
解决办法
2957
查看次数