Issue with running maven | Selenium Forum
M
Posted on 10/01/2017
Practicing module 25 for cucumber project. Its working fine when running from eclipse but while running project from maven i am getting following result:
T E S T S
-------------------------------------------------------
Running test.facebook.AppTest
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNGMapConfigur
ator@1b4fb997
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.345 sec

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ selenium.cucumber.facebook -
--
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default) > validate @ selenium.cucumber
.facebook >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default) < validate @ selenium.cucumber
.facebook <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default) @ selenium.cucumber.facebook -
--


You can implement missing steps with the snippets below:

@Given("^i go to \"([^\"]*)\" on \"([^\"]*)\"$")
public void i_go_to_on(String arg1, String arg2) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}

@Given("^i enter \"([^\"]*)\" as \"([^\"]*)\"$")
public void i_enter_as(String arg1, String arg2) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}

@Given("^i click on \"([^\"]*)\"$")
public void i_click_on(String arg1) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}

@Then("^login should be \"([^\"]*)\"$")
public void login_should_be(String arg1) throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}

Feature: Logging to facebook
Inorder to chat
i want to login

Scenario: Logging in Facebook ?[90m# test\resources
\test\facebook\login\login.feature:5?[0m
?[90mGiven ?[0m?[90mi go to "testURL" on "Mozilla"?[0m
?[1A ?[33mGiven ?[0m?[33mi go to "testURL" on "Mozilla"?[0m
?[90mAnd ?[0m?[90mi enter "loginusername" as "easen_173@hotmail.com"?[0m
?[1A ?[33mAnd ?[0m?[33mi enter "loginusername" as "easen_173@hotmail.com"?[0m

?[90mAnd ?[0m?[90mi enter "loginpassword" as "Ea@334015"?[0m
?[1A ?[33mAnd ?[0m?[33mi enter "loginpassword" as "Ea@334015"?[0m
?[90mAnd ?[0m?[90mi click on "loginsubmit"?[0m
?[1A ?[33mAnd ?[0m?[33mi click on "loginsubmit"?[0m
?[90mThen ?[0m?[90mlogin should be "success"?[0m
?[1A ?[33mThen ?[0m?[33mlogin should be "success"?[0m

M
Replied on 11/01/2017

send a screen shot.


M
Replied on 13/01/2017

Find the screen shot in attachment and here is the POM.XML file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>test.facebook</groupId>
<artifactId>selenium.cucumber.facebook</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>selenium.cucumber.facebook</name>
<url>http://maven.apache.org</url>

<properties>
<cucumber-jvm.version>1.1.2</cucumber-jvm.version>
<selenium.version>2.28.0</selenium.version>
<junit.version>4.11</junit.version>
</properties>




<build>

<!-->testResources>
<testResource>
<directory>src/main/resources</directory>
<includes>
<include>log4j.properties</include>
</includes>
</testResource>
</testResources-->


<plugins>

<!--plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0-beta-3</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>surefire-report-maven-plugin</artifactId>
</plugin-->


<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>integration-test</phase>

<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<executableDependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
</executableDependency>

<mainClass>cucumber.api.cli.Main</mainClass>
<arguments>
<argument>--format</argument>
<argument>junit:target/cucumber-junit-report/allcukes.xml</argument>
<argument>--format</argument>
<argument>pretty</argument>
<argument>--format</argument>
<argument>html:target/cucumber-html-report</argument>
<argument>--glue</argument>
<argument>com/</argument>
<argument>src/</argument>

</arguments>
</configuration>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-core</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>




</build>

<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>${cucumber-jvm.version}</version>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber-jvm.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>

</dependencies>
</project>

Responsive image

M
Replied on 13/01/2017

try mvn test.


M
Replied on 14/01/2017

try with mvn test command. it did not work. pls see screen shot attached:

Responsive image

M
Replied on 15/01/2017

zip and send your project.


M
Replied on 16/01/2017

thanks for your reply. find the zip file in attachment:
i was trying to run login test using maven.

thanks!!!!


M
Replied on 19/01/2017

Any comments!!!


M
Replied on 19/01/2017

i'm working on it. it is taking longer then expected.


M
Replied on 22/01/2017

i wasn't able to run test via maven.

so, what you can do is use antrun maven plugin.

this plugin will run ant and ant will execute your tests.

in the meantime, I'll keep working on your project. I think it is the problem with maven.


M
Replied on 22/01/2017

thanks!!!