Substeps Installation and Running Issues

67 views
Skip to first unread message

Mubbashshir Mohiuddin

unread,
Mar 31, 2015, 1:42:07 PM3/31/15
to subs...@googlegroups.com
Hi Folks, 

I have come across some issues while running Feature file in Eclipse after installation. If you have more user friendly installation document please share it and also let me know some basic checks to perform to find the issue. 


The  issues are listed below along with installation details:


1.After running my sub-steps scripts by placing some parameters in Run Configuration for chrome drivers, Browser is not loading and I am getting given below error in POM(I have attached  screen shot(Error_Message_After_Running_Feature_File) and POM file for better understanding of the issue)

Missing artifact sun.jdk:tools:jar:1.6.31
Error resolving version for plugin 'org.apache.maven.plugins:maven-compiler-plugin' from the repositories [local (C:\Users
\mohiuddm\.m2\repository), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository. 

Probably this is the main issue. I have also highlighted couple of other issues as below.


2.I have extracted Maven 3.0.5(Source.zip file) and set the paths as below but I am unable to run MVN command from dos 
  prompt.(refer snapshot "Eclipse_Unable_To_Run_Mvn_Command"). Since I have also installed M2e-maven integration for Eclipse-
  1.5.1.201.40.606. from eclipse editor. Could I ignore this?

  M2 %M2_HOME%\bin
  M2_HOME C:\Program Files\apache-maven-3.2.5\apache-maven\src
 
3.Where do we need to place the SubstepsMaven plugin 1.1.2 after downloading. It is a Jar file. Is this really required?. 
  However I could see "sub-steps maven plugin 1.1.1" in Maven dependencies under in Eclipse editor after installing M2e-maven integration for Eclipse-
  1.5.1.201.40.606. from eclipse editor. Again Could I ignore this plugin installation. 


Given below are my installation details 
============================================================================================= 
1. Installed Java JSE and JRE 1.7.0.0_75. 
2. Installed Eclipse Luna 4.4.0. 
3. Installed Eclipse plug from  http://code.technophobia.com/substeps/eclipse/stable/
4. Installed Maven 3.0.5(Source.zip file).
5. Installed Gits.
6. Installed M2e-maven integration for Eclipse-1.5.1.201.40.606.(Not sure if it is right one) 
7. Given below are the Java&Maven paths set in Evironment 

System variable:
Java_HOME C:\Progra Files\Java\jdk1.7.0_71
M2 %M2_HOME%\bin
M2_HOME C:\Program Files\apache-maven-3.2.5\apache-maven\src

8. Given below are the Eclipse and Run Configuration for the files. 

Eclipse Project==>Properties==>Substeps contents==>
Feature Folder:target\test-classes\features
Substep Folder:target\test-classes\substeps

Run Configuration values for substeps:
Run configuration==>Substeps tab
Project=webdriver-substeps-example
Feature file=target\test-classes\features\innovate\Registration.feature
substeps file/folder=src/test/resources/substeps.

Eclipse_Unable_To_Run_Mvn_Command.jpg
Error_Message_After_Running_Feature_File.jpg
Eclipse_Editor.jpg
Eclipse_Editor_Showing_JRE_System_Library_And_Maven_Dependencies.jpg
Eclipse_Software_Installation_Details.jpg
POM_Library.txt

Ian Moore

unread,
Apr 1, 2015, 3:58:33 AM4/1/15
to Mubbashshir Mohiuddin, subs...@googlegroups.com
Hi

I think there's a couple of things going on here.

Firstly maven on the command line - Windows can't find mvn - is it in your path ?  You also have M2_HOME pointing at the source folder not maven home.  If you can't run mvn -version and see some output, you haven't got maven installed correctly.

The maven plugin is necessary yes if you wish to run Substeps via maven, ie in a headless CI environment or on the command line.  Maven will download any project dependencies and plugins the project requires - this is one of the advantages of maven - so you don't need to explicitly install anything other than maven itself. 

The other problem that you see in eclipse is the unfortunate hardcoded dependency on a particular version of the JDK.  This is necessary in order to be able to generate glossary information from javadoc tags in your step implementation code.  There is an unfortunate limitation of maven and dependencies on tools.jar where the javadoc code sits - it's an unpleasant dependency we wish to remove when we get the chance.

There are workarounds however - install 1.6.31 of the JDK - you don't need to use it, it will just satisfy the dependency or remove the dependency on the glossary builder.

if you run mvn dependency:tree you will see all the dependencies of your project; the dependency on the substeps BOM (Bill of Materials) is a convenient way of including several dependencies in one, alternatively you can specify the dependencies individually:

        <dependency>
            <groupId>com.technophobia.substeps</groupId>
            <artifactId>substeps-core</artifactId>
            <version>${substeps.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.technophobia.substeps</groupId>
            <artifactId>substeps-core-api</artifactId>
            <version>${substeps.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.technophobia.substeps</groupId>
            <artifactId>substeps-junit-runner</artifactId>
            <version>${substeps.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.technophobia.substeps</groupId>
            <artifactId>webdriver-substeps</artifactId>
            <version>${substeps.webdriver.version}</version>
            <scope>test</scope>
        </dependency>

hope that helps
Ian

--
You received this message because you are subscribed to the Google Groups "Substeps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to substeps+u...@googlegroups.com.
To post to this group, send email to subs...@googlegroups.com.
Visit this group at http://groups.google.com/group/substeps.
For more options, visit https://groups.google.com/d/optout.



--
Ian Moore
Technical Architect

e: ian....@g2g3.digital

G2G3 Digital

Velocity House, 3 Solly Street, Sheffield, S1 4DE

+44 (0)114 2212123

http://g2g3.digital/


Part of Capita plc: www.capita.co.uk

Registered address: 71 Victoria Street, Westminster, London SW1H 0XA


Registered in England and Wales Company No. 03063669

VAT registration No. 618 1841 40 

Mubbashshir Mohiuddin

unread,
Apr 8, 2015, 7:37:10 AM4/8/15
to Ian Moore, subs...@googlegroups.com
Hi Ian, 

Thanks for your reply. Unfortunately I am receiving the same error: Missing artifact sun.jdk:tools:jar:1.6.31 in POM. 

1. I have installed Maven 3.2.5 properly and is it returning expected result for mvn --version as below: 
    
  Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T17:29:2
  3+00:00)
 Maven home: C:\Program Files\apache-maven-3.2.5
 Java version: 1.6.0_31, vendor: Sun Microsystems Inc.
 Java home: C:\Program Files\Java\jdk1.6.0_31\jre
 Default locale: en_GB, platform encoding: Cp1252
 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

2. I have installed Java version 1.6.0_31(Did not get 1.6.31 version) and set the path. However when I run Java -version 
    command it is giving 1.8.0_40 version as out put. Hope it is not going cause any problem. 

3.  Just to narrow down the issue further more, I am using 2.0.3 version of the project from your website i.e. sub steps and 
     same POM as available in the project(It is attached to my previous email) . And I am just trying to run the test using 
     eclipse plugin by setting some parameters in Run Configuration as mentioned in earlier email.

4. I have tried using the dependencies you have mentioned earlier i.e. substeps-core,substeps-core-ap,substeps-junit-runner. 
    However it did not resolve the issue so removed them. I am bit new to this POM though trying to understand it. Could you     give me a sample copy of PM which could work. Also could you suggest some approach to narrow down the issue. If you 
    need more information please let me know like screen shots or logs. 

with kind regards,
Mubbashshir. 

    

Ian Moore

unread,
Apr 8, 2015, 10:16:43 AM4/8/15
to Mubbashshir Mohiuddin, subs...@googlegroups.com
Hi Mubbashshir,

See the attached pom.xml which is a variant of the example project pom.xml but without the BOM dependency.  This has no dependencies on tools.jar so if this doesn't work, then I think you may have a different problem.

hope that helps
Ian
pom.xml

Mubbashshir Mohiuddin

unread,
Apr 19, 2015, 5:59:26 PM4/19/15
to Ian Moore, subs...@googlegroups.com
Hi Ian, 

Thanks a lot. After changing the following values in your POM it started running test as normal. 
Previous value
<substeps.version>1.1.1</substeps.version>
Current value
<substeps.version>1.1.2</substeps.version>

However I was trying to use sub-steps report using my current setup where I am running the tests using run configuration by adding some parameters in VM Arguments of Run Configuration as below, but the report is not loading though there are some configurations present in POM file. I am unable to understand <outputDirectory>${project.build.directory}</outputDirectory> in POM. Could you let me know what this directory is and how to load the report.

Values in VM arguments:
-Dwebdriver.chrome.driver=C:\chromedriver.exe
-Denvironment=localhost
-Dtags="google --unimplemented"

David Moss

unread,
Apr 20, 2015, 4:36:44 AM4/20/15
to Mubbashshir Mohiuddin, Ian Moore, subs...@googlegroups.com
Hi Mubbashshir,

From the Maven docs: 

Pom/Project properties:
All elements in the pom.xml, can be referenced with the project. prefix. This list is just an example of some commonly used elements. (deprecated: {pom.} prefix)
${project.build.directory} results in the path to your "target" directory, this is the same as ${pom.project.build.directory}

 In other words, the report will be written into C:\[path-to-your-project-folder]\target.

If you browse to that folder you should see the generated html report files.

Hope that helps,

Dave
David Moss
Senior Java Developer

e: david...@g2g3.digital
Reply all
Reply to author
Forward
0 new messages