tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Gallimore <jonathan.gallim...@gmail.com>
Subject Re: Functional testing with OpenEJB + Jetty + Selenium
Date Tue, 02 Sep 2008 07:58:27 GMT
Hi,

Yes, you do have to run selenium on port 4444 for this to work. With 
Maven (which I used in my sample), if you include the following in your 
pom.xml:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>selenium-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start-server</goal>
                        </goals>
                        <configuration>
                            <background>true</background>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


you can run mvn 'selenium:start-server' to run the selenium server to 
run the tests in your IDE. Running a 'mvn install' should do a full 
build and run the Selenium server whilst running the integration tests. 
The PersonApp/PersonWEB/pom.xml is a good place to look at where I've 
done the setup for this. I haven't really touched on this in the wiki 
docs, I'll add some info about this on there tonight.

If you're not running Maven, I would imagine you could start the server 
either using Ant using the <java> task, or from your test code by 
invoking the main method on org.openqa.selenium.server.SeleniumServer. I 
could do with getting this working myself, so I'll have a go and I'll 
let you know how I get on.

Hope that's helpful.

Jon


anand118 wrote:
> Don't you need to run Selenium Server at port 4444 to be able to do
> selenium.open("/products.action");?
>
> It might just be that I don't know enough about Selenium yet. If starting
> sel server is necessary, how can we automate it? Following some tutorials,
> I'm still having to use java -jar selenium-server-1.0-beta-1-standalone.jar
> -interactive and then run my test.
>
> Thanks in advance
>
>
>
> Many thanks for the kind comments guys, I'm really glad you guys think 
> its alright. I'd love to get it published if you think its good enough 
> :) David, I'll mail you offline about it in a sec. Obviously if anyone 
> has improvements or suggestions, please do let me know.
>
> Cheers
>
> Jon
>
>   


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message