Forum Discussion

ThirumalG_0504's avatar
ThirumalG_0504
Frequent Visitor
2 years ago

Trying to do Web application validation using Selenium in SOAPUI tool

Trying to do Web application validation using Selenium in SOAPUI tool but getting "NoSuchMethodError" error.

 

Below code i used:

Code:

import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import org.openqa.selenium.*

//System.setProperty("webdriver.ie.driver", "C:\\Program Files (x86)\\SmartBear\\SoapUI-5.4.0\\bin\\ext\\IEDriverServer.exe")
System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\SmartBear\\SoapUI-5.5.0\\bin\\ext\\chromedriver.exe")
//def driver = new InternetExplorerDriver()
def driver = new ChromeDriver()
driver.get("https://google.co.in")

 

 

Error:


java.lang.NoSuchMethodError: com.google.common.collect.ImmutableMap.of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableMap; error at line: 10

 

 

Im using SOAPUI 5.5 version and done following steps:

  1. Download selenium-server-standalone-2.41.0 jar - selenium-standalone-server+IEDriver
  2. Download chromedriver_win32_2.26 - chromedriver
  3. Download httpClient_4.3.4 - httpclint

Kept all the jar file inside bin/ext folder and restarted my soapui but getting same error.

 

 

4 Replies

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

     

    I'm not quite sure why you'd use SoapUI to automate using Selenium.  What would the benefit be?

    • TNeuschwanger's avatar
      TNeuschwanger
      Champion Level 2

      Hey ChrisAdams ,

       

      I am using ReadyAPI to invoke both Selenium for web application testing and Appium for mobile application testing...  It is real handy to stay on one product where we know how to use it effectively without context switching to some other tool to do web and mobile testing.  We sort of (do) save on licensing cost for other tools by consolidating those other forms of testing into ReadyAPI.  Selenium and Appium frameworks are free and do a great job at testing within ReadyAPI.  I cannot tell you how happy I feel when I invoke an API to grab some test data, use that data to invoke a web page that manipulates that data and then finally displays resultant data on a mobile phone (or phone simulator) application that we need to ship out...  All within the same ReadyAPI tool (testcase as a matter of fact)...  Tack on ReadyAPI Performance and we can load test all of it!  🙂

       

      ThirumalG_0504 ,  it is a little tricky integrating Selenium with SoapUI 5.5 since SoapUI 5.5 was released so long ago.  You should at least be trying with the latest version of SoapUI.  Selenium has been through a lot of iterations since SoapUI 5.5 so you are probably encountering some JAR version mismatches.  Regardless, it will be a little bit of trial and error getting the configuration right with the free version since JAR version collisions will probably occur.

       

      Regards,

      Todd

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi Todd,

     

    That's really interesting.  I've used Selenium quite a bit using Java, but never thought of using it with ReadyApi.

    In the context of a test case, where/how do you invoke the Appium test?  Do you use a Groovy test step?

    • TNeuschwanger's avatar
      TNeuschwanger
      Champion Level 2

      Hello ChrisAdams ,

       

      Yep, the use of selenium and/or appium are from groovy test step(s).  The whole testcase is just a bunch of groovy test steps that contain selenium or appium code with a properties test step to hold all the variables of the testcase that the test steps can use.  I end up with some common test steps that correspond to a single page or single screen navigation that are invoked in sequence to get where I want to go in the application.

       

      Regards,

      Todd