To integrate SoapUI with Selenium and work on creating scripts with it, we need the following prerequisites:
Now let's start with Selenium integration with SoapUI:
Selenium.jar
files from the following link, shown in the image:selenium-java-2.52.0.jar
and selenium-java-2.52.0-srcs.jar
from the folder.C:ProjectSoapUI
. Refer to this location).ext
folder and lib
folders please refer to the following screenshots for the complete path:ext
folder you also need to paste them in the lib
folder of SoapUI as well.After this step we are done with the setup we now need to work on the Groovy script.
Following is sample Groovy script for invoking a UI from SoapUI using Groovy script enabled by Selenium Jars:
import com.eviware.soapui.model.* import com.eviware.soapui.model.testsuite.Assertable import com.eviware.soapui.support.XmlHolder import java.io.File; def regLogger = org.apache.log4j.Logger.getLogger("RegressionTestLoger"); def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def properties = new java.util.Properties(); import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import com.thoughtworks.selenium.Selenium; WebDriver driver = new FirefoxDriver(); driver.manage().deleteAllCookies(); driver.manage().window().maximize(); WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com ");
The preceding script loads the relevant Jar and then invokes a Firefox driver or the driver of the chosen browser which invokes the URL.
It should also be noted that the version number of Selenium and the browser should be as per the following matrix.
For Windows, the following matrix shows compatibility with Firefox and Selenium versions:
For Linux, see the following compatibility matrix:
Also you may look for more details in the changelog at the following URL:
https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG
Here is the matrix for Mac:
More details on the latest matrix can be seen online at the following link:
https://recordnotfound.com/selenium-firefox-support-matrix-santiycr-120024
Now we have seen how to run our UI test in the Firefox browser, if a need arises to run the test on IE or Chrome, how should we achieve it?
Let's take it step-by-step.
18.221.136.142