cancel
Showing results for 
Search instead for 
Did you mean: 

Data source error using gitlab

SOLVED
Highlighted
Occasional Contributor

Data source error using gitlab

Hello,

While writing my tests, I import from csv.file data that are used in request (body) but when launched through GitLab, in allure reports my tests failed with : 


Error:java.io.FileNotFoundException: /projectDir/file.csv (No such file or directory) ----------------- Messages ------------------------------

 

Could you help me find the right way to write the path?

The csv files are in /projectDir/TestSuite/file.csv
I tried with 

${projectDir}/TestSuiteName

${workspaceDir}/TestSuiteName

/branch/projectName/TestSuiteName

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: Data source error using gitlab

@pizzaTime :

 

Try with this :

 

groovyutils = new com.eviware.soapui.support.GroovyUtils(context)
projectpath = groovyutils.projectPath
log.info projectpath

projectPath will return where your project is stored, try to manipulate it or place the csv file on the same location where your project is placed.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Re: Data source error using gitlab

Where is the path used? in script? test request? some configuration?
Did it work ok earlier when the tests executed from the tool? And this is specific to gitblab?


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Data source error using gitlab

Hello Rao,

Yes, sorry I totally forgot about it : 

I'm using a DataSource step so I first used it through "Browse".

 

In another project, I'm trying to get a readme, to use it in a body, I'm trying by Groovy script.

 

Kind regards,

 

pizzaTime

Highlighted
Community Leader

Re: Data source error using gitlab

@pizzaTime :

 

Try with this :

 

groovyutils = new com.eviware.soapui.support.GroovyUtils(context)
projectpath = groovyutils.projectPath
log.info projectpath

projectPath will return where your project is stored, try to manipulate it or place the csv file on the same location where your project is placed.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

Highlighted
Community Manager

Re: Data source error using gitlab

Thank you for input nmrao, HimanshuTayal!

 

@pizzaTime did you have a chance to give the suggestion a try? 


Sonya Mihaljova
Community and Education Specialist
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Check out this week's challenge!

Create a script to generate an email when an assertion fails for the TechCorner tag!


Scripts created in July:
- A script to change the request body before sending it to the server