Forum Discussion

mrtibs's avatar
mrtibs
New Contributor
14 years ago

how to read from Excel with Groovy

Hi,

I need to set many properties whose values come from an Excel file. I don't want to use a DataSource, because there are hundreds of these values/properties and I think it is easier to script them. What is the best way of reading from an Excel file in Groovy? Can I make use of any SoapUI classes, or do I need to use Scriptom or something like that?

I started using Scriptom, and after nailing the correct release (1.5.4), I finally have the following code:

import org.codehaus.groovy.scriptom.*;
import org.codehaus.groovy.scriptom.tlb.office.excel.XlChartType
import org.codehaus.groovy.scriptom.tlb.office.excel.XlSheetType
import org.codehaus.groovy.scriptom.tlb.office.excel.XlRowCol
import org.codehaus.groovy.scriptom.tlb.office.excel.XlChartLocation
import org.codehaus.groovy.scriptom.tlb.office.excel.Excel;
import org.codehaus.groovy.scriptom.util.office.ExcelHelper;

def addresses = new File('Prices.xls').canonicalPath
def xls = new ActiveXObject('Excel.Application')
def workbooks = xls.Workbooks
def workbook = workbooks.Open(addresses)
def sheet = workbook.ActiveSheet
def rate1 = sheet.Range("B17").Value
workbook.Close(false, null, false)
xls.Quit()
xls.release()

testRunner.testCase.setPropertyValue( "rate1", rate1 )

The problem with this is that xls.Release() throws "com.jacob.com.ComFailException: A COM exception has been encountered: At Invoke of: 1610612738 Description: Member not found.". If I take out xls.Release() then the Excel process stays open after close. Someone else had a similar issue: http://groovy.329449.n5.nabble.com/FW-S ... 71390.html. I tried to follow the thread, but couldn't make it work.

Dos anyone have any ideas how to make this work? Am I going in a wrong direction with Scriptom? How active is the Scriptom development? It looks like a dieing project...

Thanks,
Tiberiu
  • mrtibs's avatar
    mrtibs
    New Contributor
    Scriptom.releaseApartment() worked for me. However, I still want to know if this is the preferred way of doing things when you have to read a bunch of single values from an Excel workbook.
  • Hi..
    i tried using the same script but am getting quite a few exceptions...

    Please find the Script and the Exception below.


    Requesting someone to please look into this..
    - Siva

    Code--

    import org.codehaus.groovy.scriptom.*;
    import org.codehaus.groovy.scriptom.tlb.office.excel.XlChartType;
    import org.codehaus.groovy.scriptom.tlb.office.excel.XlSheetType;
    import org.codehaus.groovy.scriptom.tlb.office.excel.XlRowCol;
    import org.codehaus.groovy.scriptom.tlb.office.excel.XlChartLocation;
    import org.codehaus.groovy.scriptom.tlb.office.excel.Excel;
    import org.codehaus.groovy.scriptom.util.office.ExcelHelper;
    import org.codehaus.groovy.scriptom.ActiveXProxy;

    def address = new File('TestData_Enrolment.xls').canonicalPath
    def xls = new ActiveXObject('Excel.Application')
    def Workbooks = xls.Workbooks
    def sheet = Workbooks.ActiveSheet
    def value1 = sheet.Range('B37').Value
    workbook.Close(false, null, false)
    xls.Quit()
    xls.release()

    testRunner.testCase.setPropertyValue("value1", value1)


    Exceptions:-


    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script7.groovy: 3: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlSheetType @ line 3, column 1. import org.codehaus.groovy.scriptom.tlb.office.excel.XlSheetType; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlSheetType @ line 3, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1250) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Script7.groovy: 5: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlChartLocation @ line 5, column 1. import org.codehaus.groovy.scriptom.tlb.office.excel.XlChartLocation; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlChartLocation @ line 5, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1250) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Script7.groovy: 2: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlChartType @ line 2, column 1. import org.codehaus.groovy.scriptom.tlb.office.excel.XlChartType; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlChartType @ line 2, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1250) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Script7.groovy: 7: unable to resolve class org.codehaus.groovy.scriptom.util.office.ExcelHelper @ line 7, column 1. import org.codehaus.groovy.scriptom.util.office.ExcelHelper; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.codehaus.groovy.scriptom.util.office.ExcelHelper @ line 7, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1250) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Script7.groovy: 8: unable to resolve class org.codehaus.groovy.scriptom.ActiveXProxy @ line 8, column 1. import org.codehaus.groovy.scriptom.ActiveXProxy; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.codehaus.groovy.scriptom.ActiveXProxy @ line 8, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1250) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Script7.groovy: 4: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlRowCol @ line 4, column 1. import org.codehaus.groovy.scriptom.tlb.office.excel.XlRowCol; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.XlRowCol @ line 4, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1250) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Script7.groovy: 6: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.Excel @ line 6, column 1. import org.codehaus.groovy.scriptom.tlb.office.excel.Excel; ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class org.codehaus.groovy.scriptom.tlb.office.excel.Excel @ line 6, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1250) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Script7.groovy: 11: unable to resolve class ActiveXObject @ line 11, column 11. def xls = new ActiveXObject('Excel.Application') ^ org.codehaus.groovy.syntax.SyntaxException: unable to resolve class ActiveXObject @ line 11, column 11. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:148) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:226) at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:236) at org.codehaus.groovy.control.ResolveVisitor.transformConstructorCallExpression(ResolveVisitor.java:1094) at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:768) at org.codehaus.groovy.control.ResolveVisitor.transformDeclarationExpression(ResolveVisitor.java:1134) at org.codehaus.groovy.control.ResolveVisitor.transform(ResolveVisitor.java:760) at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:139) at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:165) at org.codehaus.groovy.control.ResolveVisitor.visitBlockStatement(ResolveVisitor.java:1345) at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:51) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112) at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:50) at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:171) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123) at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1039) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1288) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148) at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:814) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 8 errors
    SivaramakrishnaR
    Newbie


    Posts: 1
    Joined: 27 Jun 2011 13:52
  • Vamshidhar's avatar
    Vamshidhar
    New Contributor
    how to use DataSource in soap Ui pro. someone please help. I am totally new for testing and soap UI too
  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    Vamshidhar wrote:
    how to use DataSource in soap Ui pro. someone please help. I am totally new for testing and soap UI too

    if u use soapUI pro, u can add datasource step through right-click on test case. for example, there is a excel with some data exist in external file, and you can create the same columns within excel in soapUI.
  • Aaronliu's avatar
    Aaronliu
    Frequent Contributor
    Finan wrote:
    I'd suggest you take a look at apache poi:

    http://poi.apache.org/apidocs/org/apach ... mmary.html

    I've no experience with reading cells from excel sheets, but writing to excel is fairly easy with poi, so I assume reading from excel should be too.


    Hi Finan,
    yes,I download poi from apache,but,I don't know how to configure these properties? would you please post configuration in detail? thanks
  • Player433's avatar
    Player433
    New Contributor
    You could use a CSV (Comma Separated File) and then just use simple file access commands.