繁体   English   中英

用于移动测试的Selenium Webdriver

[英]Selenium Webdriver for Mobile testing

我收到以下错误

运行Appium命令时出错:无法调用null的方法“发送”

在iPhone上进行硒测试时。 在Android上也是如此。 潜在的问题是什么? 任何帮助表示赞赏。

引发错误的代码是:

  public static boolean focusWindowByHandle(int inWindowIndex)
  {
    boolean blResult = false;
    try
    {
      Object[] arrWindowHandles = GenericKeyword.driver.getWindowHandles().toArray();
      if (inWindowIndex <= arrWindowHandles.length - 1) {
        String strWindowHandle = GenericKeyword.driver.getWindowHandles().toArray()[inWindowIndex].toString();
        GenericKeyword.driver.switchTo().window(strWindowHandle);
        blResult = true;

我想将其发布为评论,但由于可读性,我将其发布在本节中。

您可以检查您的“ appium.js”版本是否具有如下确切的代码段?

logger.info('Shutting down appium session...');
   if (this.isSafariLauncherApp === true) {
     this.device.leaveWebView(function() {
      if (this.device.udid === null) {
      if (this.device.udid === null && this.device.instruments !== null) {
         this.device.instruments.shutdown(function() {
           this.cleanupSession(null, cb);
         }.bind(this));

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM