Archive for the ‘teststep’ Category

Disclaimer : This post was in my DRAFT for almost 8+ month and i happened to check my blog DRAFTS today hence clearing this. Please do excuse the delay in the response to your queries, i will try to post answers now.

Having worked on selenium tool for almost 4 month and being an addicted soapUI tester, i thought it would be great if both these tool can work together. Lately, after having spent some amount of time i found the way to go for it.

Before starting on integration of soapUI & Selenium, i had to find a common link & it was none other than GROOVY.

Yes, Selenium WebDriver supports groovy & soapUI is having a smooth integration with Groovy. So this is the common factor to go with. So start with the writing the code, download the GROOVY SDK, JAVA SDK, Selenium Standalone Driver & any IDE which support Groovy. Put the downloaded Selenium Standalone driver.jar file into the soapui/bin & soapui/lib folder before executing the  scripts.

Download links : 

Groovy SDK :
Selenium Standalone :
JAVA SDK : From Sun/Oracle website, download latest.

My Conclusion :
Best API test tool + Best Web Automation tool = GREATNESS in testing Web API application End to End.

@Author : Pradeep Bishnoi
@Description : .
@GroovyTestStepName : "Launch Selenium"
import org.openqa.selenium.By
 import org.openqa.selenium.WebDriver
 import org.openqa.selenium.WebElement
 import org.openqa.selenium.OutputType
 import org.openqa.selenium.Keys

WebDriver driver = new InternetExplorerDriver()   //This will launch IE, for Firefox use --> FirefoxDriver()

driver.get("") // Url to be opened driver.getSessionId().toString()

 WebElement element = driver.findElement("s"))

 File f1 = driver.getScreenshotAs(OutputType.FILE)
 FileUtils.copyFile(f1, new File("c:\\screenshot1.png")); // Location to save screenshot


 driver.getKeyboard ().pressKey (Keys.DOWN)
 driver.getKeyboard ().pressKey (Keys.DOWN)
 driver.getKeyboard ().pressKey (Keys.DOWN)
 driver.getKeyboard ().pressKey (Keys.UP)
 driver.getKeyboard ().pressKey (Keys.UP)
 driver.getKeyboard ().pressKey (Keys.UP)
catch(Exception e)
{ "Exception encountered : " + e.message