groovy.lang.MissingMethodException:没有方法的签名: [英] groovy.lang.MissingMethodException: No signature of method:

查看:7003
本文介绍了groovy.lang.MissingMethodException:没有方法的签名:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从soapUI运行java eclipse文件。这些文件目前在Eclipse中运行良好,但是当试图在soapUI中运行时,会显示以下错误消息。

I am trying to run java eclipse files from soapUI. The files currently run fine in Eclipse, however when attempted to be run in soapUI, the following error message is shown.

groovy.lang.MissingMethodException:
  No signature of method: com.company.automation.testing.Test()
  is applicable for argument types: (java.lang.String)
                            values: [https://avcedevn1.mas.nsroot.net:17765/]
  Possible solutions: init(java.lang.String, java.lang.Boolean), wait(), wait(long), wait(int), any(), print(java.lang.Object)

我认为这表示init参数已设置错误,但我相信我有他们正确设置为init(String,Boolean)。为什么显示这个错误信息,我该如何解决它?

I think this suggests that the init parameters are set wrong however I believe I have them set up correctly as init(String, Boolean). Why is this error message shown and how can I resolve it?

代码来自soapUI groovyscript:

code from soapUI groovyscript:

import com.company.automation.testing.Test

def env = testRunner.testCase.testSuite.project.getPropertyValue("env")
def baseUrl = testRunner.testCase.testSuite.project.getPropertyValue("baseUrl")

log.info("The baseurl is "+baseUrl)
log.info("The env under test is "+env)

Test testStep = new Test();
testStep.init(baseUrl);
testStep.execute(null);

来自Eclipse的代码片段:

code snippet from Eclipse:

  package com.company.automation.testing;

    import com.eviware.soapui.model.support.AbstractSubmitContext;
    import com.eviware.soapui.model.testsuite.TestRunner;

    public class Test extends BaseSelenium {
       public static void main(final String[] args) {
          final Test trial = new Test();
          try {
             trial.init("https://avcedevn1.mas.nsroot.net:17765/", false);
          } catch (Exception e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
          trial.execute(null);
       }

Eclipse中的BaseSelenium类代码片段:

BaseSelenium class code snippet in Eclipse:

public void init(final String baseUrl, Boolean useDifferentNavigURL) throws Exception {

      this.startTime = System.currentTimeMillis();

      driver = new InternetExplorerDriver();

      this.baseUrl = baseUrl;

      selenium = new WebDriverBackedSelenium(driver, baseUrl);
   }


推荐答案

我想你错过了布尔参数,而从SoapUI调用

I guess you missed the boolean parameter while calling from SoapUI

testStep.init(baseUrl);

这篇关于groovy.lang.MissingMethodException:没有方法的签名:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆