Ask a Question

calling script from soapui

kola
New Contributor

calling script from soapui

Hi i just want to find out I have a selenium webdriver script in eclipse how can i call this script from soapui/ready api

3 REPLIES 3
avidCoder
Super Contributor

 

You can create .jar file for the selenium project and put it inside SOAPUI HOME/bin/ext and call the package file using import into Ready API. And then create object:- You can refer this code :-

 

//seleniumProject  package from eclipse

import seleniumProject.*  

//CopyingExcel is class from seleniumProject

def excel= new CopyingExcel() 

//addColumn() is method of CopyingExcel class

def val = excel.addColumn() 
kola
New Contributor

Hi Thank you for your response getting this error message java.lang.NullPointerException

avidCoder
Super Contributor

Null Pointer Exception means there is some problem with your selenium code. I'll show you a demo here. How it works. I have attached a jar file with this answer. Download this jar file and put inside soapui home/bin/ext and then write this line of code in to soap ui :-

 

import pack.*

def b = new Test()
def c = b.addition(3,4)

log.info c
log.info("Hello")

It will print you this:-

 

  • Wed Mar 07 23:06:52 IST 2018:INFO:7
  • Wed Mar 07 23:06:52 IST 2018:INFO:Hello

And before creating any jar file please fix the java errors and then export it as jar.

cancel
Showing results for 
Search instead for 
Did you mean: