Last week I have learnt several things on writing Selenium Tests for XWiki.
Selenium is a portable software testing framework for web applications. XWiki uses Selenium for their integration testing. While I am learning how to write selenium tests I have learnt several things. Hope it would help others some times to blog here. XWiki mailing list and IRC helped me a lot to solve issues I faced. :)
I have started with
Writing Selenium Tests For XWiki tutorial.
I wrote a test,
com.xpn.xwiki.it.selenium.LoginObservationTest for the JIRA issue
XWiki-3697.
After writing the test case, For first time run, I went to /enterprise/distribution-test/selenium-tests directory and run the following command as in tutorial
mvn install -Dpattern=LoginObservationTest
It showed an error saying
java.lang.RuntimeException: Firefox couldn't be found in the path!
Please add the directory containing 'firefox-bin' to your PATH environment
variable, or explicitly specify a path to Firefox like this:
*firefox /blah/blah/firefox-bin
The problem is that by default Ubuntu used Firefox 3. Here are the use ful steps to run your XWiki selenium tests with FF3.
- Add your FF3 path to $PATH, if this does not work only change the pom.xml browser path to
<browser>*firefox /path/to/firefox3/firefox-bin</browser>
- change pom.xml selenium-maven-plugin version to
<version>1.0-rc-2</version>
- Enjoy running selenium tests with FF3. :)