sandy
sandy

Reputation: 117

Testng and selenium Grid

Iam Automating an Android app using appium with java. Being a beginner i would like to know the difference between TestNG and grid. Surfed but dint get the answer.

Upvotes: 0

Views: 145

Answers (1)

Krishnan Mahadevan
Krishnan Mahadevan

Reputation: 14746

TestNG is a Test Runner and lets you do the following:

  1. Helps you call out specific methods as test methods.
  2. Helps you define setup and tear down which is like defining entry and exit criteria that are to be met for running your tests.
  3. Helps you logically group your test methods based on some classification, so that you can run the group of tests easily.
  4. Helps you define dependencies amongst tests, so that they will mimic how you test manually.
  5. Helps you build data driven test methods, so that you can run the same test with different sets of data.
  6. Helps you define how to run tests (Should they be run sequentially or if they can be run concurrently)
  7. Provides you with some basic reporting and also lets you build custom reporting.
  8. Lets you define listeners so that you can do some adhoc processing based on different events (for e.g., test started, test finished, test passed, test failed, test skipped etc.,)

and a lot more.

Selenium Grid is a mechanism/utility/tool that helps you run your tests on a remote environment. It lets you point your tests at the grid and the grid will basically run your tests in a different environment (which needn't be the same as your local desktop). Since you mentioned appium, here's a typical use case. Lets say you are trying to run some iOS automation tests, but you only have a windows machine at your disposal.

Had you setup a Grid environment such that it has a node that is running on a OSX machine, then the tests that are spun off by a test runner on your windows machine can be delegated and routed to be executed on the remote OSX machine.

The grid contains two parts to it.

  1. Hub - Imagine this to be like a manager. It basically gets request to run a new test from your desktop, finds out which of the nodes (attached to it) can run this test (based on the capabilities) and if a match is found, the test is routed to that particular node.
  2. Node - Imagine this to be like a team member. This is the component that actually does the work of opening up a browser and performing all the user actions that your test is trying to do.

Upvotes: 2

Related Questions