Run Selenium in Tapestry Maven Project

If you want to know how to run Selenium in a Maven webapp project, you can refer to the following post.
Selenium – Integrate the Selenium Tests into Maven Build
 

If you are a Tapestry user, the pom.xml in the above article may not work as the webapp cannot be started in the Embedded Jetty (404 Not Found). I am not sure the reason behind but i find a work around to solve the problem. The tricky thing is in the Embedded Jetty configuration in the cargo2-maven-plugin.

So if u meet the same problem, try to modify the cargo2-maven-plugin configuration in the pom.xml as follow.

...
<plugin>
	<groupId>org.codehaus.cargo</groupId>
	<artifactId>cargo-maven2-plugin</artifactId>
	<version>1.0.2-SNAPSHOT</version>
	<executions>
		<execution>
			<id>start-container</id>
			<phase>pre-integration-test</phase>
			<goals>
				<goal>start</goal>
			</goals>
		</execution>
		<execution>
			<id>stop-container</id>
			<phase>post-integration-test</phase>
			<goals>
				<goal>stop</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<wait>false</wait>
		<container>
			<containerId>jetty6x</containerId>
			<type>embedded</type>
		</container>
		<!-- For Tapestry user -->
		<configuration>
			<deployables>
				<deployable>
					<properties>
						<context>/</context>
					</properties>
				</deployable>
			</deployables>
		</configuration>
	</configuration>
</plugin>
...

 

If you have any idea about the failure reason, please let me know =)
 

Done =)

Reference: maven2でjettyを起動してseleniumを使う

About these ads

One thought on “Run Selenium in Tapestry Maven Project

  1. Pingback: Selenium – Integrate the Selenium Tests into Maven Build | Eureka!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s