In the last week my task was to create stable functional tests for a new eCommerce application. We picked several use cases, e.g.: clicking through the different links, logging in, searching for products and actually buying a product. We needed functional tests that run on both Internet Explorer and Firefox. With these tests we want to make sure to automatically find any functional problems but also performance and architectural problems (e.g: too many JavaScript files on the site, too many exceptions on the server or too many database statements executed for a certain test scenario). We also want to find problems that happen on certain browsers – therefore the task of letting these tests run on the two major browsers

Test Framework: Selenium WebDriver

As test framework I decided to pick Selenium WebDriver and downloaded the latest version. I really thought it is easier to write tests that work in a similar way on both browsers. I have several lessons learned

  1. When you write a script always test it immediately on both browsers
  2. Use a Page Object approach when developing your scripts. With that you keep the actual implementation separated from the test cases (you will see my test scripts later in this blog – will make more sense when you see it)
  3. Be aware of different behaviors of IE and FF
  4. Make sure your test code can deal with unexpected timings or error situations

Continue reading the full blog