Forum Discussion

Sachin0911's avatar
Sachin0911
New Contributor
7 years ago

NoSuchMethodError SimpleTimeLimiter Error while invoking Chromedriver in ReadyAPI Groovy

Hi,

 

I am trying to invoke chromedriver from readyapi using groovy. But I am stuck.

 

My code:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

System.setProperty("webdriver.chrome.driver", "ext/ChromeDriver.exe");
def driver = new ChromeDriver();

 

Error message:

java.lang.NoSuchMethodError: com.google.common.util.concurrent.SimpleTimeLimiter.create(Ljava/util/concurrent/ExecutorService;)Lcom/google/common/util/concurrent/SimpleTimeLimiter; error at line: 6

 

Libraries in bin/ext folder are:

byte-buddy-1.7.5.jar
client-combined-3.8.1.jar
client-combined-3.8.1-sources.jar
commons-codec-1.10.jar
commons-exec-1.3.jar
commons-logging-1.2.jar
gson-2.8.2.jar
httpclient-4.5.3.jar
httpcore-4.4.6.jar
chromedriver.exe
postgresql-9.3-1102.jdbc41.jar
readme.txt
sqljdbc42.jar
guava.jar

 

Please suggest

  • Nastya_Khovrina's avatar
    Nastya_Khovrina
    SmartBear Alumni (Retired)

    Hi Sachin,

     

    Can you please let us know more details about your configuration? What versions of

    - Google Chrome;

    - ReadyAPI;

    - guava library;

     

    do you use?

  • I'm having the same problem. I have forced internal upgrades on chrome.

    currently Chrome v66

    Chromedriver.exe v2.38

    Selenium 3.11 (I also backed down to v3.91 because I can launch a browser in Eclipse)

     

    I have all of the lib files aas well loaded into the /ext directory.

    • Nastya_Khovrina's avatar
      Nastya_Khovrina
      SmartBear Alumni (Retired)

      Hi,

       

      Starting from Selenium 3, you will need to use GeckoDriver (add the following System Property):

      System.setProperty("webdriver.gecko.driver", "C:/Program Files/SmartBear/ReadyAPI-2.3.0/bin/ext/geckodriver.exe");

      How to use Firefox in Selenium using geckodriver in Selenium 3: 
      http://learn-automation.com/use-firefox-selenium-using-geckodriver-selenium-3/
      http://www.automationtestinghub.com/selenium-3-0-launch-firefox-with-geckodriver/

       

      But note that the versions of Selenium Server Standalone starting from 3.6 aren't compatible with an old version of the guava library which is used in ReadyAPI (guava-20.0.jar). To make it work, you will need to replace guava library file guava-20.0.jar with the guava-23.0.jar in this folder: C:\Program Files\SmartBear\ReadyAPI-2.3.0\lib. You can download the guava library version 23.0 from here: https://github.com/google/guava/wiki/Release23

       

      Here is the sample script which you can use:

       

      import org.openqa.selenium.By;
      import org.openqa.selenium.firefox.FirefoxDriver;
      import org.openqa.selenium.WebElement;
      
      System.setProperty("webdriver.gecko.driver", "C:/Program Files/SmartBear/ReadyAPI-2.3.0/bin/ext/geckodriver.exe");   //Change the path
      def driver = new FirefoxDriver();
      log.info("Go to the example page");
      driver.get("http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onclickEX1.htm");
      log.info("Enter the 'Test' query string");
      def query = driver.findElement(By.xpath("//*[@name='txtOutput']"));
      query.sendKeys("Test");
      log.info("List the suggestions");
      def allSuggestions = driver.findElements(By.xpath("//*[@name='txtOutput']"));
      log.info("Post the value of the element or an error if no elements with the appropriate value were found.");
      for (def suggestion : allSuggestions) {
        if(suggestion.getAttribute('value') != '')
          log.info(suggestion.getAttribute('value'));
        else
          log.error('The test failed.')
      }
      log.info("Now quit");
      driver.quit();
      • sprice090161's avatar
        sprice090161
        Contributor

        Nice! Thank you Anastasia.

        Yes, I knew it was a guava issue but I thought it would be the the one included in the libraries folder in the Webdriver download. I place all of them into the /ext directory. I grabbed the latest version on friday and placed it in /ext. Okay, I'll put a copy in /lib as you suggested.

         

        Here is my issue. I can't work with just FF. I need IE and Chrome as well. I have a ticket for this that I entered last Dec. No one responded to my email last week, including our Account mgr/Customer success mgr, so I opened a new ticket today referrencing the original ticket. 

         

        Case #00293069 has been created: ReOpen Case #00271684: Ready_API Not Compatible Launching V62 Chrome Browser

         

        Wait.....I forgot (Sorry, stream of consciousness)

        I have Chrome defined with Options to support my network environmnet....I hate to describe this whole thing but there is a defect with chromediver.exe, where it attempts to install a browser plugin to controll the browser window. ITs not an issue for most people but in my network we have policy rules enforcing no browser plugins can me downloaded and installed if they are not whitelisted first. The folks at chromium were nice enough to provide the plugin ID, however it no longer exists as a download and whitlisting the ID doesn't help. They were supposed to remove the plugin and add it all to the Chrome Developer Tools but so far thats not happening so I'm stuck with the workaround, configuring the chrome option:

         

        ChromeOptions options = new ChromeOptions();
        options.setExperimentalOption("useAutomationExtension", false);

         

        I need the equivilent for FF but I haven't been able to find it.... :-(

         

        Thank you for your response. 

         

        Regards

         

        Steve