Can any one help here belo is my script
Script :
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
import com.eviware.soapui.model.testsuite.TestRunner.Status
import com.eviware.soapui.model.project.ProjectFactoryRegistry
import com.eviware.soapui.impl.wsdl.WsdlProjectFactory
import com.eviware.soapui.impl.wsdl.*
import com.eviware.soapui.impl.wsdl.testcase.*
import com.eviware.soapui.model.testsuite.*
import com.eviware.soapui.model.support.PropertiesMap;
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner
import com.eviware.soapui.impl.WorkspaceImpl;
import java.io.File
def Workspace = testRunner.getTestCase().getTestSuite().getProject().getWorkspace()
def Project = (Workspace==null) ?
ProjectFactoryRegistry.getProjectFactory(WsdlProjectFactory.WSDL_TYPE).createNew('$Workspace') :
Workspace.getProjectByName("Automation")
if(!Project.open && Workspace!=null) Workspace.openProject(Project)
def datasource = context.expand( '${DataSource#set}' )
def Lib = Project.getTestSuiteByName("Library");
testCase = Lib.getTestCaseByName("TC_CreateAccount");
log.info "testcase Name="+testCase
Error :
ERROR [errorlog] An error occurred in the script of the Groovy Script test step [GroovyScript2]:
ERROR [errorlog] java.lang.NullPointerException: Cannot invoke method getTestCaseByName() on null object
Solved! Go to Solution.
One should refrain using workspace object if automation needs to be achieved.
And the use case please?
Hey,
Where is the script placed? Is it in a groovy script step? Why do you need to get the workspace?
Hi @678,
Did the suggestion given here point you in the right direction to find a solution?
Guru experts, What can we suggest here?
@Lucian, @nmrao, @msiadak, @richie, @avidCoder
I have in plan to take a look at it later today.
I think to propery troubleshoot this I would need to see at least a screenshot of the project so we can see the layout of the test suites / test cases / etc.
Subject | Author | Latest Post |
---|---|---|