Running Selenium tests on CI server

1,098 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,098
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Running Selenium tests on CI server

  1. 1. Running Selenium tests on CI server
  2. 2. Hudson Selenium Grid Hub Selenium Grid Node 1 Selenium Grid Node 2 Web App Server JUnit with RemoteWebDriver REST Selenium Grid Node X Databases
  3. 3. Hudson <ul><ul><li>Runs tests once an hour </li></ul></ul><ul><ul><li>Checks out tests from SVN </li></ul></ul><ul><ul><li>Different jobs for each browser (passing environment variable to tests) </li></ul></ul><ul><ul><li>Runs ANT tasks </li></ul></ul><ul><ul><li>ANT finds dependencies from IVY </li></ul></ul><ul><ul><li>ANT runs several JUnit suites in parallel (<parallel/>) </li></ul></ul><ul><ul><li>Hudson JUnit Attachments plugin stores failure screen shots next to test results </li></ul></ul>
  4. 4. Web App Server <ul><ul><li>Runs our application </li></ul></ul><ul><ul><li>Updated manually </li></ul></ul><ul><ul><li>Could be updated by some Hudson job </li></ul></ul><ul><ul><li>Development environment </li></ul></ul>
  5. 5. Selenium Grid Hub <ul><ul><li>Java Web App on Jetty </li></ul></ul><ul><ul><li>Listens for Hudson requests and redirects them to suitable nodes </li></ul></ul><ul><ul><li>Request contains desired OS, browser name and browser version </li></ul></ul>
  6. 6. Selenium Grid Node 1 <ul><ul><li>Java Web App on Jetty </li></ul></ul><ul><ul><li>Starts required browser and executes tests </li></ul></ul><ul><ul><li>Runs on Ubuntu </li></ul></ul><ul><ul><li>Configured to run 10 Firefox instances </li></ul></ul><ul><ul><li>(Doesn't have Chrome because we were lazy) </li></ul></ul><ul><ul><li>Could have different versions of Firefox, but we used only latest </li></ul></ul><ul><ul><li>Could be headless with Xvfb instead of monitor </li></ul></ul>
  7. 7. Selenium Grid Node 2 <ul><ul><li>Runs on Windows </li></ul></ul><ul><ul><li>Can run 5 instances of Firefox </li></ul></ul><ul><ul><li>Can run 5 instances of Chrome </li></ul></ul><ul><ul><li>Can run 1 instance of Internet Explorer (IE WebDriver does not support more than one instance) </li></ul></ul><ul><ul><li>Could have different versions of all browsers, but we used only latest </li></ul></ul>
  8. 8. Selenium Grid Node X <ul><ul><li>You can have as many nodes as you like </li></ul></ul><ul><ul><li>Extra nodes help with running tests in parallel </li></ul></ul><ul><ul><li>Extra nodes provide more OS options </li></ul></ul><ul><ul><li>Extra nodes provide more stable test environment </li></ul></ul><ul><ul><li>Extra nodes combined with parallel tests can keep test time as low as you want </li></ul></ul>
  9. 9. REST <ul><ul><li>Interface provided by Web App </li></ul></ul><ul><ul><li>Used to prepare and clean up data </li></ul></ul><ul><ul><li>Tests do not have access to database </li></ul></ul><ul><ul><li>If some test data preparation is required, then same thing is required for testers. By providing REST interface, we make test data preparation accessible for testers. </li></ul></ul>
  10. 10. Questions?

×