Ask a Question

[Resolved (walkaround)] ProjectPath issue

Liberty_Informa
Regular Contributor

[Resolved (walkaround)] ProjectPath issue

Hi

This is something urgent!

I have two soapUI projects. Name mentioned here are just for understanding purpose
1. ExampleSoapUI
2. CallingSoapUI

ExampleSoapUI is a normal soapUI project created from the wsdl containing 1 testsuite and 16 test cases.
CallingSoapUI has been created blank. It does not contain any wsdl or testSuite. The purpose of this project is to call many more soapUI projects like "ExampleSoapUI" in it's load script.

ExampleSoapUI is located at:
D:\Workspaces\Workspaces1\ContinuousTests\soapui\DomainServices\Admin\ExampleSoapUI-soapui-project.xml

CallingSoapUI is located at:
D:\Workspaces\Workspaces1\ContinuousTests\soapui\ContainerServices\Container1\CallingSoapUI-soapui-project.xml

I retrieve projectPath value in the ExampleSoapUI's load script using below code:

groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
projectPath = groovyUtils.projectPath


When I run "ExampleSoapUI", I get value correctly which is nothing but D:\Workspaces\Workspaces1\ContinuousTests\soapui\DomainServices\Admin

When I run "CallingSoapUI" soapUI project, it calls "ExampleSoapUI" project however the projectPath value which I see in the script.log is:

D:\Workspaces\Workspaces1\ContinuousTests\soapui\ContainerServices

Why it is not D:\Workspaces\Workspaces1\ContinuousTests\soapui\ContainerServices\Container1 ?
Why "\Container1" is missing when I run "ExampleSoapUI" from "CallingSoapUI" ?

I think it has to do with the context object.

What should I do so that I get correct projectPath value when I call "ExampleSoapUI" from "CallingSoapUI"?

This is a major road block while working on test automation framework. Can you please tell us the alternative or guide us what are we doing wrong here?
Regards,
LIT

This post in no way reflect any Policies of Liberty Information Technology Ltd.
2 REPLIES 2

Re: ProjectPath issue

Hi,

I'm trying to reproduce this, but it's proving to be a bit difficult. In the mean time, you could try using the following load script to get the project file path instead:
def pathWithoutProtocol = new File(project.path).parent.replaceAll("file:", "");

This workaround will possibly resolve your issue if the problem is with the context variable.

Regards,

Arian
SmartBear Sweden


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Liberty_Informa
Regular Contributor

Re: ProjectPath issue

This is marvellous Arian!!!

It is working for me. I will add few more interesting stuff later that what was I trying before you send this workaround.

If I really take this one as a workaround, we need to find out long lasting solution as well.

Till then happy days!

Thanks.
Regards,
LIT

This post in no way reflect any Policies of Liberty Information Technology Ltd.
cancel
Showing results for 
Search instead for 
Did you mean: