How can I create a relative classpath so other people can execute my Selenium Webdriver scripts

Hi, Im trying to create a relative classpath, currently my classpath is:

C:/Users/jmoren02/workspace/TestProject/bin;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/poi-3.10.1-20140818.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/poi-scratchpad-3.10.1-20140818.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/poi-examples-3.10.1-20140818.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/poi-excelant-3.10.1-20140818.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/poi-ooxml-3.10.1-20140818.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/poi-ooxml-schemas-3.10.1-20140818.jar;C:/Users/jmoren02/workspace/TestProject/src/junit-4.12-beta-1.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/ooxml-lib/dom4j-1.6.1.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/ooxml-lib/stax-api-1.0.1.jar;C:/Users/jmoren02/workspace/TestProject/src/poi-3.10.1/ooxml-lib/xmlbeans-2.6.0.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/aopalliance-repackaged-2.2.0.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/commons-codec-1.6.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/commons-logging-1.1.3.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/eyes-sdk-java-2.4.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/eyes-selenium-java-2.5.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/hamcrest-core-1.3.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/hk2-api-2.2.0.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/hk2-locator-2.2.0.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/hk2-utils-2.2.0.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/httpclient-4.3.1.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/httpcore-4.3.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/jackson-annotations-2.1.2.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/jackson-core-2.1.3.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/jackson-databind-2.1.3.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/javassist-3.18.1-GA.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/javax.annotation-api-1.2.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/javax.inject-2.2.0.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/javax.ws.rs-api-2.0.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/jersey-apache-connector-2.6.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/jersey-client-2.6.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/jersey-common-2.6.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/jersey-guava-2.6.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/junit-4.11.jar;C:/Users/jmoren02/workspace/TestProject/src/eyes.selenium.java_2_5/osgi-resource-locator-1.0.1.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/selenium-java-2.43.1.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/selenium-java-2.43.1-srcs.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/apache-mime4j-0.6.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/bsh-1.3.0.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/cglib-nodep-2.1_3.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/commons-codec-1.9.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/commons-collections-3.2.1.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/commons-exec-1.1.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/commons-io-2.4.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/commons-jxpath-1.3.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/commons-lang3-3.3.2.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/commons-logging-1.1.3.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/cssparser-0.9.14.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/guava-15.0.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/hamcrest-core-1.3.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/hamcrest-library-1.3.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/htmlunit-2.15.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/htmlunit-core-js-2.15.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/httpclient-4.3.4.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/httpcore-4.3.2.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/httpmime-4.3.4.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/ini4j-0.5.2.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/jcommander-1.29.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/jetty-websocket-8.1.8.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/jna-3.4.0.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/jna-platform-3.4.0.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/json-20080701.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/junit-dep-4.11.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/nekohtml-1.9.21.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/netty-3.5.7.Final.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/operadriver-1.5.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/phantomjsdriver-1.1.0.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/protobuf-java-2.4.1.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/sac-1.3.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/serializer-2.7.1.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/testng-6.8.5.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/xalan-2.7.1.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/xercesImpl-2.11.0.jar;C:/Users/jmoren02/workspace/TestProject/selenium-2.43.1/libs/xml-apis-1.4.01.jar

And I tried to replace  C:/Users/jmoren02 with ../ but it doesnt work. It’s display the error

Error: Could not find or load main class org.testng.TestNG

Could you please give me some guidance? Thanks in advance.

Julio

Juliow Train Asked on March 4, 2015 in Selenium WebDriver.
Add Comment
1 Answer(s)

WHat you need to do is

C:/Users/jmoren02/workspace/TestProject/bin   will become   /TestProject/bin
usually the slash is different, if above doesnt work try with this slash

C:\Users\jmoren02\workspace\TestProject\bin   will become   \TestProject\bin

Virender

Virender Singh Professor Answered on March 5, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.