Category Archives: Testing

Memory leak with Spring integration test context caching

I’ve recently had to debug another out of memory with our Spring integration tests. The tests are configured to create a heapdump on out of memory so I loaded it up with the Eclipse Memory Analyser and this is what … Continue reading

Posted in Java, Spring, Testing | Tagged , , | Leave a comment

Memory leak with TestNG and Spring DirtiesContext annotation

We recently added some new integration tests to our test suite. All three tests were Spring integration tests. Normally in a Spring integration test, the entire code for a test method operates in a single transaction, and at the end … Continue reading

Posted in Java, Testing, TestNG | Tagged , , | Leave a comment

Effective Selenium testing

Selenium is the de facto standard for testing web applications. In this article I’m going to cover a number of techniques for improving your Selenium tests. The article is suitable for you if: You already know the basics of Selenium … Continue reading

Posted in Selenium, Testing, Uncategorized | Tagged , | 1 Comment

Inserting large amounts of data into MySQL with LOAD DATA INFILE

Suppose you want to do some performance testing on your application and you want to insert a large number of database records, what is the fastest way to do it? You could write some Java code that creates a PreparedStatement … Continue reading

Posted in MySQL, Performance, Testing | Tagged , , | Leave a comment

Automating Selenium testing with TestNG, Ant and CruiseControl

If you are using Selenium for web testing, most likely you’ll want to make your tests as automated as possible so that they can be run automatically on a regular basis. You can do this by using a few additional … Continue reading

Posted in Ant, Selenium, Testing | Tagged , | 2 Comments

Multiple test configurations with TestNG

I use TestNG for automated testing as it has a number of features that JUnit doesn’t have. One of its strengths is the power and flexibility of configuring tests and supplying parameters to them, for which there are two methods: … Continue reading

Posted in Groovy, Testing | Tagged , | Leave a comment

Tutorial: Writing XPath selectors for Selenium tests

Selenium is the most commonly used web testing framework. It allows you to write tests in Java that can perform standard “web” actions such as filling in forms, clicking buttons etc. Usually, a test will take the following form: Open … Continue reading

Posted in Selenium, Testing | Tagged , | 53 Comments

Showing unused TestNG tests

We use TestNG for our system tests. One of the slight problems is that if a new test is written, but not added to the testng.xml file, it won’t be run. I like to monitor our testing progress, so I … Continue reading

Posted in Testing | Tagged | 1 Comment