Forum Discussion
divman
11 years agoContributor
Thank You Marcus.
your code helped me to resolve that issue. But i am facing another exception. The error now is...
...
...
...
12:06:04,313 INFO [DefaultSoapUICore] Adding listeners from [C:\Program Files (x86)\SmartBear\SoapUI-Pro-4.6.4\bin\listeners\demo-listeners.xml]
12:06:04,320 INFO [DefaultSoapUICore] Adding plugin from [C:\Program Files (x86)\SmartBear\SoapUI-Pro-4.6.4\bin\plugins\soapui-groovy-console-plugin-1.0-plugin.jar]
12:06:05,219 INFO [WsdlProject] Loaded project from [file:/C:/Capital%20One/Xpress/Groovy%20Automation/Holds%20Inquiry/Holds-Inquiry---Groovy-Automation-soapui-project.xml]
12:06:05,304 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Manimaran\GroovyClasses]
12:06:05,614 INFO [SoapUIProTestCaseRunner] Running SoapUI tests in project [Holds Inquiry - Groovy Automation]
12:06:05,637 INFO [SoapUIProTestCaseRunner] Running TestCase [Holds_Inquiry_Testcase]
12:06:06,371 INFO [WsdlProject] Loaded project from [file:/C:/Capital%20One/Xpress/Groovy%20Automation/Library%20and%20Methods/Library-soapui-project.xml]
12:06:06,694 ERROR [AbstractTestRunner] Exception during Test Execution
java.lang.NullPointerException: Cannot invoke method getLogArea() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at InitializeTestData.FirstData(Script1.groovy:31)
...
...
...
To be clear...as i said in my previous post, the code which i has in Setup Script which calls the the library code in the library project, which my "InitializeTestData" code is below..could you please help me to resolve what is the problem here...?
Much appreciate your help.
your code helped me to resolve that issue. But i am facing another exception. The error now is...
...
...
...
12:06:04,313 INFO [DefaultSoapUICore] Adding listeners from [C:\Program Files (x86)\SmartBear\SoapUI-Pro-4.6.4\bin\listeners\demo-listeners.xml]
12:06:04,320 INFO [DefaultSoapUICore] Adding plugin from [C:\Program Files (x86)\SmartBear\SoapUI-Pro-4.6.4\bin\plugins\soapui-groovy-console-plugin-1.0-plugin.jar]
12:06:05,219 INFO [WsdlProject] Loaded project from [file:/C:/Capital%20One/Xpress/Groovy%20Automation/Holds%20Inquiry/Holds-Inquiry---Groovy-Automation-soapui-project.xml]
12:06:05,304 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [C:\Manimaran\GroovyClasses]
12:06:05,614 INFO [SoapUIProTestCaseRunner] Running SoapUI tests in project [Holds Inquiry - Groovy Automation]
12:06:05,637 INFO [SoapUIProTestCaseRunner] Running TestCase [Holds_Inquiry_Testcase]
12:06:06,371 INFO [WsdlProject] Loaded project from [file:/C:/Capital%20One/Xpress/Groovy%20Automation/Library%20and%20Methods/Library-soapui-project.xml]
12:06:06,694 ERROR [AbstractTestRunner] Exception during Test Execution
java.lang.NullPointerException: Cannot invoke method getLogArea() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at InitializeTestData.FirstData(Script1.groovy:31)
...
...
...
To be clear...as i said in my previous post, the code which i has in Setup Script which calls the the library code in the library project, which my "InitializeTestData" code is below..could you please help me to resolve what is the problem here...?
class InitializeTestData
{
log.info("inside InitializeTestData class........")
def log
def context
def testRunner
def InitializeTestData(logIn,contextIn,testRunnerIn)
{
this.log = logIn
this.context = contextIn
this.testRunner = testRunnerIn
}
def FirstData(sourceSheet, dataverifySheet, dFormatter, fEval, projectPath)
{
def headerRow, sourceRow, headerRow_value, sourceRow_cell
def dataheaderRow, datasourceRow, dataheaderRow_value, datasourceRow_cell
def ran_num, random, randomInteger
def datetime, ReportPath, folder, soapuilogclear
int m, n, i
//clear all the logs before start of test suite everytime
log.info ("1....")
try
{
log.info ("2....")
com.eviware.soapui.SoapUI.logMonitor.getLogArea("soapUI log").clear()
} catch(Exception ex)
{
log.info ("3....")
com.eviware.soapui.SoapUI.logMonitor.getLogArea("SoapUI log").clear()
}
log.info ("4....")
com.eviware.soapui.SoapUI.logMonitor.getLogArea("script log").clear()
log.info ("5....")
com.eviware.soapui.SoapUI.logMonitor.getLogArea("http log").clear()
log.info ("6....")
com.eviware.soapui.SoapUI.logMonitor.getLogArea("error log").clear()
log.info ("7....")
//Read in the contents of the first row. Set to 1 if we have headers
headerRow = sourceSheet.getRow(0)
sourceRow = sourceSheet.getRow(1)
for(m=0; m<headerRow.getLastCellNum(); m++)
{
headerRow_value = headerRow.getCell(m)
sourceRow_cell = sourceRow.getCell(m)
testRunner.testCase.setPropertyValue(headerRow_value.toString(),dFormatter.formatCellValue(sourceRow_cell,fEval))
}
}
}
context.setProperty( "InitializeTestData", new InitializeTestData( log, context, testRunner) )
Much appreciate your help.
Related Content
- 11 years agomike_lyons
Recent Discussions
- 2 days agogroovyguy