Call selenium inside SoapUI?

I was instructed to check out some web services. I use SOAPUI to test web services before and, in addition, SELENIUM to test some web applications. My current task includes testing some oauth services. Basically I need to go through oauth authentication with SELENIUM and save the received access token and pass it through my SOAPUI test to test the services. I read many blogs about integrating selenium with SOAPUI, but I did not see or show how to do this. I am using a MacbookPro with SOAPUI 4.0.1 Any help would be much appreciated.

+3
source share
2 answers

I could call the Webdriver instance in SOAP Groovy Script and approve the API with the user interface statements that follow below:

Step1: Go to the bin / ext directory to install SoapUI and drop your standalone selenium server files (all banks in this path will be downloaded to your path, you can add any jar files in this place and call them in Groovy Script)

C: Program Files / SmartBearSoapUI -Pro-4.6.4 / bin / ext

Jar file Name: selenium-server-standalone-2.40.0

Step 2. Create a new project in the SOAP user interface

Step 3: Add New Groovy Script Step

Step 4. Create your selenium driver using the Script below in Groovy Step (Groovy is built in Java, so all JAVA libraries and code will work as such)

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

    WebDriver driver = new FirefoxDriver(); 
    driver.get("http://www.google.com ") 
    log.info("Pagee is: " + driver.getTitle()) 
    driver.quit()

Step 5: run the script

  • You may need to restart the soapui session for the first time.

API JAVA Webdriver, API REST

https://code.google.com/p/rest-assured/

, .

+2

, selenium-server-standalone-*.jar $SOAPUI_HOME/bin/ext; SoapUI.

Selenium script Groovy script Groovy : . - :

def chromeDriverBinary = new File("selenium/bin/windows/googlechrome/32bit/chromedriver.exe")
assert chromeDriverBinary.canExecute()
System.setProperty("webdriver.chrome.driver", chromeDriverBinary.canonicalPath)

def driver = new ChromeDriver()
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS)
driver.get("http://www.website.test")

, , : http://siking.wordpress.com/2011/08/22/groovy-selenium-webdriver-and-soapui-part-3/ , - ?

+1

All Articles