Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8806543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:09:09+00:00 2026-06-14T02:09:09+00:00

Hi I am using Maven for Selenium automation tests using Java. I am using

  • 0

Hi I am using Maven for Selenium automation tests using Java. I am using Excel Sheet to read data for filling up a registration form. Now It is a normal Maven archetype.

src
--main
  --java
    --mypackage for coding goes here.
  --resources
    --data
      -- the excel sheet
--test
  -- some stuff here under java

currently if I want to read a file I am writing src/main/resources/data/theexcelsheet.xlsx
but when I share this jar, I think this will break and I don’t want this to break if I package this jar.

How do I make it platform or format independent.

I am using APACHE POI Api if you are thinking how I am reading files.

Someone reading gave me idea that I might be able to use MANIFEST files to do this but I am not sure, can someone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:09:10+00:00Added an answer on June 14, 2026 at 2:09 am

    If you use getResource() to point to your file, the syntax of the path always uses / to separate the components, never \ so you do not have to worry.

    In general, outside of a jar, for example if you want to save application settings in a folder, you have to use a OS specific separator – you can obtain it this way:

    System.out.println("my" + File.separator + "dir");

    Returns my\dir on Win and my/dir on Linux

    Of course, that’s not enough as you cannot use hardcoded paths like the “c:” drive, but you can get the most common paths reading the System class properties, eg:

    System.out.println(System.getProperty("user.home"));
    

    returns C:\Users\piero in Windows7 and /home/piero in Linux

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna run selenium tests from TeamCity using Maven at Linux server without display.
I am using Jetty and Selenium to automate some unit tests from my Maven
We are using JUnit - Selenium for our web tests. We use Maven to
After I run a bunch of Selenium (jUnit4) tests using Maven, I'd like to
I ran WebDriver tests using Maven from Jenkins on Linux. My selenium automated tests
I'm using maven to run my selenium tests but it doesn't find this tests
I'm trying to run a series of selenium tests using maven and I get
i am using maven,java,sts eclipse and selenium ide, svn and web driver in ubuntu.i
If I'm using Maven to manage my Java EE web services projects, are there
I would like to run parallel selenium tests (using webriver and the Spring JUnit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.