Forum Discussion

DonaldCREMI's avatar
DonaldCREMI
New Contributor
4 years ago

Unable to start a Selenium browser session using SoapUI 5.6.0

## 🐛 Bug Report

Attempting to launch a Firefox browser session as a SoapUI TestStep causes a NoSuchMethodError to occur when run using Ubuntu 20.04.2 LTS environment

## To Reproduce

Detailed steps to reproduce the behavior:

1. Follow the Selenium installation directions including the installation of the geckodriver for a Linux or Windows OS
2. Install SoapUI open source version 5.6.0
3. Move copies of the Selenium JAR files to the SoapUI /bin/ext folder
4. Launch SoapUI
5. Create a SoapUI TestSuite
6. Create a SoapUI TestCase
7. Create a SoapUI TestStep using the provided test script
8. Start the TestStep

## Expected behavior

A Firefox Browser window should open

## Test script or set of commands reproducing this issue

```
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

def project = testRunner.testCase.testSuite.project;

String strNAESBPurchasedStandardsURI = project.getPropertyValue("NAESBPurchasedStandardsURI");
log.info("NAESB Purchased Standards Screen URI: " + strNAESBPurchasedStandardsURI);

System.setProperty("webdriver.gecko.driver","/usr/local/bin/geckodriver");
WebDriver driver = new FirefoxDriver();
context["driver"] = driver;
driver.get(strNAESBPurchasedStandardsURI);
```
## Generated Stack Overflow

```
Wed Aug 18 15:19:38 EDT 2021:ERROR:java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:146)
at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:44)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.usingFirefoxBinary(GeckoDriverService.java:160)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:187)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:238)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:242)
at Script1.run(Script1.groovy:11)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:90)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
```


## Environment

OS: Ubuntu 20.04.2 LTS
Browser: Firefox
Browser version: 91.0 (64-bit) Mozilla Friefox for Ubuntu cononical -1.0
Browser Driver version: geckodriver-v.0.29.1-linux64
Language Bindings version: java 11.0.7 2020-04-14 LTS
Selenium Grid version (if applicable): NA

  • nmrao's avatar
    nmrao
    Champion Level 3
    I think this is not really specific to SoapUI, rather how you are invoking in groovy or java.
    Can you invoke the same groovy outside of the soapUI and able to launch browser?

    By the way, look for error on the internet.
    com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
    java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
    • DonaldCREMI's avatar
      DonaldCREMI
      New Contributor

      Yes, the same code outside of SoapUI launched the browser.

       

      I have searched the error on the internet and the only responses to the query are stackoverflow responses.  The best is:

      "The versions of the libraries you are using do not fit together. Basically you should check the release information for the version of selenium you are using. That should contain information about which version of guava you need to use!"

      I've tried this solution, but it does not fix the problem.

    • DonaldCREMI's avatar
      DonaldCREMI
      New Contributor

      Thanks,

       

      The problem turned out to be the guava.jar version.  By upgrading the release version (guava-14.0) to the latest version (guava-31.0.1-jre), I was able to start Selenium from within the open-source SoapUI application.  SoapUI-5.7.0 still ships with the guava-14.0 jar.  I attempted to make a contribution to upgrade guava to the latest version, but was unable to find the contribution agreement (the link on the SoapUI site is broken).