Forum Discussion

silverghost's avatar
silverghost
Regular Visitor
8 years ago

Setting up Selenium with Soapui to run Groovy scripts

Hi all,

I have spent the last week trying to set up my laptop so that I can run Selenium scripts using Groovy steps and have unfortunately hit a brick wall. I have resorted to downloading VMWare and have installed a clean version of Windows 10 on it which gives me the facility to mess around with the installation and if I mess things up go back to a clean snapshot.

My current install is -

 

1. Download and install 64bit SOAPUI freeware
2. Download Selenium-server-standalone-2.53.1.jar and put in C:\Program Files\SmartBear\SoapUI-5.2.1\bin\ext folder
3. Install Firefox 47.0.1
4. Install Selenium IDE/ Selenium IDE Button and Firebug (Firefox Addons)
5. Install Java (Java platorm JDK 8u101/8u102)- http://www.oracle.com/technetwork/java/javase/downloads/index.html - jdk-8u101-windows-x64.exe - installed into C:/Program Files/Java/JRE1.8.0_101
6. Download selenium-server-2.53.1.zip, place the 'selenium-server-2.53.1.jar' and 'selenium-server-2.53.1-srcs.jar' in the C:\Program Files\SmartBear\SoapUI-5.2.1\bin\ext folder, and the contents in the libs folder in C:\Program Files\SmartBear\SoapUI-5.2.1\lib
7. Go through the C:\Program Files\SmartBear\SoapUI-5.2.1\lib folder contents and remove any old versions of files, in my case these were -
a. commons-codec-1.3.jar (left version 1.10 in the folder)
b. commons-logging-1.1.1.jar (left version 1.2 in the folder)
c. guava-14.0.jar (left version 19.0 in the folder)
d. httpclient-4.1.1.jar (left version 4.5.1 in the folder)
e. httpcore-4.1.1.jar (left version 4.4.3 in the folder)
f. httpmime-4.1.1.jar (left version 4.5 in the folder)
g. jetty-util-6.1.26.jar (left version 9.2.13.v20150730 in the folder)
h. junit-4.11.jar (left version 4.12 in the folder)
i. xml-apis-1.3.04.jar (left version 2.9.1 in the folder)

 

 

When I run the following groovy script -
----------------------------------------------------
import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

driver = new FirefoxDriver();
baseUrl = "https://www.google.co.uk/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get(baseUrl + "/?gws_rd=ssl");
driver.findElement(By.id("lst-ib")).clear();
driver.findElement(By.id("lst-ib")).sendKeys("SOAPUI");
driver.findElement(By.linkText("SoapUI | Functional Testing for SOAP and REST APIs")).click();

driver.quit();
----------------------------------------------------

Firefox opens for a second or so with the following info onscreen -

'The address isn't valid', the URL shows 'about:blank&utm_content=firstrun


Firefox then closes and SOAPUI errors with -
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:09' System info: host: 'DESKTOP-RR0416B', ip: '192.168.11.128', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_55' Driver info: driver.version: FirefoxDriver error at line: 10

 

 

Any help on my installation steps (I think they are correct but can't be sure) would be really appreciated as I am really stuck now.

I have also updated the 'Hosts'file in C:\Windows\System32\drivers\etc and add a row at the bottom as '127.0.0.1 localhost', I got this info after searching the internet for solutions, but unfortunately the only difference it made was when I opened SOAPUI following the change, Windows Firewall asked me to add 'SOAPUI' as a trusted private network source.

 

Thanks in advance, any advice would be must appreciated

Chris

No RepliesBe the first to reply