Forum Discussion

PrakashKannan's avatar
PrakashKannan
Contributor
6 years ago

Using Geb in SoapUI/ReadyAPI

I want to perform some webpage interaction as part of my API testing. Do we have option to use Geb in soapUI ? or is there any option to perform webpage interaction from groovy ?

3 Replies

  • groovyguy's avatar
    groovyguy
    Champion Level 1

    I've seen posts here on the forums of loading a Selenium driver into Groovy and using that to automate / interact with webpages  in ReadyAPI with a groovy test step.  It looks lik Geb is similar and is built to work in groovy. Does Geb come with a jar file or something similar? If so, you can load it into ReadyAPI and import it into the groovy script test steps and use it that way. 

     

    This page lists that you can get a Geb jar, and references Selenium jars as well. https://www.softwaretestinghelp.com/geb-tutorial-browser-automation-testing-using-geb-tool/

     

    You would likely need those and would need to load them into ReadyAPI by placing them in the ReadyApi\bin\ext folder, I believe. Then restart ReadyAPI.

    • PrakashKannan's avatar
      PrakashKannan
      Contributor

      Thanks . I accessed the selenium in ReadyAPI.

       

      1. Got all the Selenium jars & drivers and kept in custom folder called 'lib' - C:\Program Files\SmartBear\ReadyAPI-2.4.0_1\bin\lib

      2.Referred this folder in preference> ReadyAPI > Custom Java Libraries & restarted the ReadyAPI

      3. Accessed driver via groovy script test step

       

      import org.openqa.selenium.WebDriver;
      import org.openqa.selenium.chrome.ChromeDriver;
      import org.openqa.selenium.firefox.FirefoxDriver;

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

      def driver= new FirefoxDriver()
      driver.get("http://www.google.com")
      driver.close()

  • sanj's avatar
    sanj
    Super Contributor

    I usually put the jar files in lib folder of Ready API install location for eg

    C:\Program Files\SmartBear\ReadyAPI-2.2.0\lib

    In my case I find it easier to code in Java and have a groovy wrapper to call these Java APIs.