Category Archives: Selenium

Selenium – Element not found in the cache

You probably will come across the following error frequently when writing Selenium test case for a Ajax-rich website.

  • Error: Element not found in the cache – perhaps the page has changed since it was looked up

 

This is because the Selenium WebDriver reference to your element would now be stale as the DOM has been modified by Ajax. To resolve the problem in Java, you can make us of the WebDriverWait and find the element each time before you use it.
Continue reading Selenium – Element not found in the cache

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.
Continue reading Run Selenium in Tapestry Maven Project

Selenium – Integrate the Selenium Tests into Maven Build

In this article, i will show you how to integrate the Selenium tests into a Maven webapp project using the selenium-maven-plugin and cargo-maven2-plugin.

In this example, i used JUnit as the testing framework. There is no problem if you use TestNG to replace JUnit. This example is a simple Java webapp Maven project which only shows a simple html page (index.jsp). During the build, a Selenium Server is started with the webapp deployed in the Embedded Jetty. It then runs an Unit Test (Selenium Test) during the Maven integration-test life cycle. Here comes to the code.
Continue reading Selenium – Integrate the Selenium Tests into Maven Build

Selenium – Automation Tools for Web Application Testing

Selenium is a suite of tool to automate web application testing. Unlike the unit testing in backend application, it is hard to test user interface in frontend application. Thanks Selenium, it makes frontend testing much easier and fun.

Selenium are 3 sets of tools.

  1. Selenium IDE – A Firefox plugin to record and convert user actions into different programming language (Selenium tests)
  2. Continue reading Selenium – Automation Tools for Web Application Testing