Cannt run cucumber on maven | Selenium Forum
M
Posted on 19/10/2015
The cucumber framework that I have created , I am trying run with on cmd but its showing the below error.
Attached is the POM.xml file I am using.

C:\Users\Sadhana\Workspace\CucumberSF>mvn integration-phase
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CucumberSF 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.076 s
[INFO] Finished at: 2015-10-19T16:45:35-06:00
[INFO] Final Memory: 8M/231M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "integration-phase". You must specify a valid li
fecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id
>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are
: validate, initialize, generate-sources, process-sources, generate-resources, p
rocess-resources, compile, process-classes, generate-test-sources, process-test-
sources, generate-test-resources, process-test-resources, test-compile, process-
test-classes, test, prepare-package, package, pre-integration-test, integration-
test, post-integration-test, verify, install, deploy, pre-clean, clean, post-cle
an, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhase
NotFoundException

C:\Users\Sadhana\Workspace\CucumberSF>

Also if I want to run differet test cases on eclipse then for each individual file/testcase I have to put the runner.java under the package where test case is located, right ?

M
Replied on 19/10/2015

see if this q/a helps

http://stackoverflow.com/questions/16784423/how-to-run-unittests-in-maven-which-is-in-src-test-integration-java-folder


M
Replied on 21/10/2015

It worked when I changed the the phase name, but After I ran my test cases it executing the texts correctly but the below message is appended to the result dunno why.

Feature: Logging into Salesforce

In order to work
As a sales person
I want to login

@login
Scenario Outline: Loggin in salesforce ?[90m# test\resources\salesforc
e\login\login.feature:8?[0m
?[36mGiven ?[0m?[36mI go to "loginURL" on "<Browser>"?[0m
?[36mAnd ?[0m?[36mI enter "username_xpath" as "<Username>"?[0m
?[36mAnd ?[0m?[36mI enter "password_xpath" as "<Password>"?[0m
?[36mAnd ?[0m?[36mI click on "loginButton"?[0m
?[36mThen ?[0m?[36mLogin should be "<ExpectedResult>"?[0m

Examples:

@login
Scenario Outline: Loggin in salesforce ?[90m# test\
resources\salesforce\login\login.feature:17?[0m
?[90mGiven ?[0m?[90mI go to "?[0m?[90m?[1mloginURL?[0m?[90m" on "?[0m?[90m?[
1mMozilla?[0m?[90m"?[0m ?[90m# LoginTest.I_go_to_sales
force(String,String)?[0m
?[1A ?[32mGiven ?[0m?[32mI go to "?[0m?[32m?[1mloginURL?[0m?[32m" on "?[0m?[3
2m?[1mMozilla?[0m?[32m"?[0m ?[90m# LoginTest.I_go_to_s
alesforce(String,String)?[0m
?[90mAnd ?[0m?[90mI enter "?[0m?[90m?[1musername_xpath?[0m?[90m" as "?[0m?[9
0m?[1mtestingselenium2015@gmail.com?[0m?[90m"?[0m ?[90m# CommonUtil.I_enter(Stri
ng,String)?[0m
?[1A ?[32mAnd ?[0m?[32mI enter "?[0m?[32m?[1musername_xpath?[0m?[32m" as "?[0
m?[32m?[1mtestingselenium2015@gmail.com?[0m?[32m"?[0m ?[90m# CommonUtil.I_enter(
String,String)?[0m
?[90mAnd ?[0m?[90mI enter "?[0m?[90m?[1mpassword_xpath?[0m?[90m" as "?[0m?[9
0m?[1msadhanapanda123?[0m?[90m"?[0m ?[90m# CommonUtil.I_enter(Stri
ng,String)?[0m
?[1A ?[32mAnd ?[0m?[32mI enter "?[0m?[32m?[1mpassword_xpath?[0m?[32m" as "?[0
m?[32m?[1msadhanapanda123?[0m?[32m"?[0m ?[90m# CommonUtil.I_enter(
String,String)?[0m
?[90mAnd ?[0m?[90mI click on "?[0m?[90m?[1mloginButton?[0m?[90m"?[0m
?[90m# CommonUtil.I_click_On(String)?[0m
?[1A ?[32mAnd ?[0m?[32mI click on "?[0m?[32m?[1mloginButton?[0m?[32m"?[0m
?[90m# CommonUtil.I_click_On(String)?[0m
?[90mThen ?[0m?[90mLogin should be "?[0m?[90m?[1mSuccess?[0m?[90m"?[0m
?[90m# LoginTest.Login_should_be(String)?[0m
?[1A ?[31mThen ?[0m?[31mLogin should be "?[0m?[31m?[1mSuccess?[0m?[31m"?[0m
?[90m# LoginTest.Login_should_be(String)?[0m
?[31morg.junit.ComparisonFailure: expected:<[Success]> but was:<[Failure]>

at org.junit.Assert.assertEquals(Assert.java:115)
at org.junit.Assert.assertEquals(Assert.java:144)
at salesforce.topmenu.LoginTest.Login_should_be(LoginTest.java:43)
at ?.Then Login should be "Success"(test\resources\salesforce\login\logi
n.feature:13)
?[0m

@login
Scenario Outline: Loggin in salesforce ?[90m# test\resources\salesforce\login
\login.feature:18?[0m
?[90mGiven ?[0m?[90mI go to "?[0m?[90m?[1mloginURL?[0m?[90m" on "?[0m?[90m?[
1mMozilla?[0m?[90m"?[0m ?[90m# LoginTest.I_go_to_salesforce(String,String)?[0m
?[1A ?[32mGiven ?[0m?[32mI go to "?[0m?[32m?[1mloginURL?[0m?[32m" on "?[0m?[3
2m?[1mMozilla?[0m?[32m"?[0m ?[90m# LoginTest.I_go_to_salesforce(String,String)?[
0m
?[90mAnd ?[0m?[90mI enter "?[0m?[90m?[1musername_xpath?[0m?[90m" as "?[0m?[9
0m?[1mxxx?[0m?[90m"?[0m ?[90m# CommonUtil.I_enter(String,String)?[0m
?[1A ?[32mAnd ?[0m?[32mI enter "?[0m?[32m?[1musername_xpath?[0m?[32m" as "?[0
m?[32m?[1mxxx?[0m?[32m"?[0m ?[90m# CommonUtil.I_enter(String,String)?[0m
?[90mAnd ?[0m?[90mI enter "?[0m?[90m?[1mpassword_xpath?[0m?[90m" as "?[0m?[9
0m?[1mxxx?[0m?[90m"?[0m ?[90m# CommonUtil.I_enter(String,String)?[0m
?[1A ?[32mAnd ?[0m?[32mI enter "?[0m?[32m?[1mpassword_xpath?[0m?[32m" as "?[0
m?[32m?[1mxxx?[0m?[32m"?[0m ?[90m# CommonUtil.I_enter(String,String)?[0m
?[90mAnd ?[0m?[90mI click on "?[0m?[90m?[1mloginButton?[0m?[90m"?[0m
?[90m# CommonUtil.I_click_On(String)?[0m
?[1A ?[32mAnd ?[0m?[32mI click on "?[0m?[32m?[1mloginButton?[0m?[32m"?[0m
?[90m# CommonUtil.I_click_On(String)?[0m
?[90mThen ?[0m?[90mLogin should be "?[0m?[90m?[1mFailure?[0m?[90m"?[0m
?[90m# LoginTest.Login_should_be(String)?[0m
?[1A ?[32mThen ?[0m?[32mLogin should be "?[0m?[32m?[1mFailure?[0m?[32m"?[0m
?[90m# LoginTest.Login_should_be(String)?[0m

C:\Users\Sadhana\Workspace\CucumberSF>


M
Replied on 23/10/2015

looks to be a problem in "feature file"


M
Replied on 23/10/2015

Below is my feature file content and its running test correctly but after all executions are done above error message is showing...
Also it never shows such message when I run through runner file.
The reports are also generating correctly.


Feature: Logging into Salesforce

In order to work
As a sales person
I want to login

@login
Scenario Outline: Loggin in salesforce
Given I go to "loginURL" on "<Browser>"
And I enter "username_xpath" as "<Username>"
And I enter "password_xpath" as "<Password>"
And I click on "loginButton"
Then Login should be "<ExpectedResult>"

Examples:
|Browser |Username |Password |ExpectedResult|
|Mozilla |testingselenium@gmail.com |abc |Success |
|Mozilla |xxx |xxx |Failure |


M
Replied on 24/10/2015

[quote:3hohshyl]Also it never shows such message when I run through runner file.
The reports are also generating correctly.[/quote:3hohshyl]

so when is error coming? when executing by pom?


M
Replied on 24/10/2015

Yes on cmd while running through Pom


M
Replied on 27/10/2015

then upload your project here.


M
Replied on 28/10/2015

Please find my project attached here with.


M
Replied on 29/10/2015

its working for me. [color=#FF0000:616kzs5e]maven install[/color:616kzs5e].


[attachment=2:616kzs5e]Screenshot (11).png[/attachment:616kzs5e]

[attachment=1:616kzs5e]Screenshot (12).png[/attachment:616kzs5e]

[attachment=0:616kzs5e]Screenshot (13).png[/attachment:616kzs5e]

Responsive image

M
Replied on 29/10/2015

Yes, For me also its running fine on cmd, generating reports correctly . BUT after test cases are run the above error is showing .(See Screenshot )

Did you see anything after all testcases are completely executed ?

Responsive image

M
Replied on 30/10/2015

I couldn't execute the entire project because SalesForce tracks IP and was asking for a verification code which I don't have.

but it didn't gave any error like you are having.