简体   繁体   English

groovy.lang.MissingMethodException:没有方法的签名:

[英]groovy.lang.MissingMethodException: No signature of method:

I am trying to run java eclipse files from soapUI. 我正在尝试从soapUI运行Java eclipse文件。 The files currently run fine in Eclipse, however when attempted to be run in soapUI, the following error message is shown. 这些文件当前在Eclipse中运行良好,但是当尝试在soapUI中运行时,显示以下错误消息。

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)

I think this suggests that the init parameters are set wrong however I believe I have them set up correctly as init(String, Boolean). 我认为这表明init参数设置错误,但是我相信我已将它们正确设置为init(String,Boolean)。 Why is this error message shown and how can I resolve it? 为什么显示此错误消息,我该如何解决?

code from soapUI groovyscript: 来自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);

code snippet from Eclipse: 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);
       }

BaseSelenium class code snippet in Eclipse: Eclipse中的BaseSelenium类代码段:

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调用时错过了布尔参数

testStep.init(baseUrl);

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

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