I am initiating some Selenium tests from a TeamCity build. These tests run fine when I run them from comand with mvn test
for example. But when running through Teamity we get the error message "Could not find or load main class Online".
From reaidng various articles with similar error I was thinking it's to do with Classpath so I made some changes to my system variables but problem persists.
I have put below my various system variables and also my project structure if this helps.
I'm a bit confused by the error message which states a class of 'Online' but I dont have a class called this in my project.
CLASSPATH = .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
JAVA_HOME = C:\Program Files\Java\jdk-9.0.4
JDK_HOME = %JAVA_HOME%
JRE_HOME = C:\TeamCity\jre
Path = C:\Projects\BDD\MDA Online Framework\Maven\apache-maven-3.5.4\bin;%JAVA_HOME%\bin;other path stuff here
Project structure:
MDA Online Framework
├───.idea
│ ├───dictionaries
│ └───libraries
├───Maven
│ └───apache-maven-3.5.4
│ ├───bin
│ ├───boot
│ ├───conf
│ │ └───logging
│ └───lib
│ ├───ext
│ └───jansi-native
│ ├───freebsd32
│ ├───freebsd64
│ ├───linux32
│ ├───linux64
│ ├───osx
│ ├───windows32
│ └───windows64
├───Reporting
│ ├───ADAWA
│ ├───DPL
│ ├───MOP
│ ├───MOS
│ ├───OA
│ ├───TPOS
│ └───wikipedia.html
├───run
├───Selenium
│ └───libs
├───src
│ ├───main
│ │ ├───java
│ │ └───resources
│ └───test
│ ├───java
│ │ ├───config
│ │ ├───Database
│ │ ├───Pages
│ │ └───stepdefs
│ │ ├───MOPStepDefs
│ │ ├───MOSStepDefs
│ │ ├───OAStepDefs
│ │ └───TPOSStepDefs
│ └───Resources
│ ├───MOP Features
│ ├───MOS Features
│ ├───Online Apps
│ └───TPOS
└───target
├───classes
├───generated-sources
│ └───annotations
├───generated-test-sources
│ └───test-annotations
├───maven-status
│ └───maven-compiler-plugin
│ ├───compile
│ │ └───default-compile
│ └───testCompile
│ └───default-testCompile
├───surefire-reports
└───test-classes
├───config
├───Database
├───MOP Features
├───MOS Features
├───Online Apps
├───Pages
├───stepdefs
│ ├───MOPStepDefs
│ ├───MOSStepDefs
│ ├───OAStepDefs
│ └───TPOSStepDefs
└───TPOS