|
| 1 | +Mink at a Glance |
| 2 | +================ |
| 3 | + |
| 4 | +There's huge amount of browser emulators out there, like `Goutte`_, `Selenium`_, |
| 5 | +`Sahi`_ and others. They all do the same job, but do it very differently. |
| 6 | +They behave differently and have very different API's. But, what's more important, |
| 7 | +there is actually 2 completely different types of browser emulators out there: |
| 8 | + |
| 9 | +* Headless browser emulators |
| 10 | +* Browser controllers |
| 11 | + |
| 12 | +First type browsers are simple pure HTTP specification implementations, like |
| 13 | +`Goutte`_. Those browser emulators send a real HTTP requests against an application |
| 14 | +and parse the response content. They are very simple to run and configure, |
| 15 | +because this type of emulators can be written in any available programming |
| 16 | +language and can be run through console on servers without GUI. Headless |
| 17 | +emulators have both advantages and disadvantages. Advantages are simplicity, |
| 18 | +speed and ability to run it without the need of a real browser. But this |
| 19 | +type of browsers has one big disadvantage, they have no JS/AJAX support. |
| 20 | +So, you can't test your rich GUI web applications with headless browsers. |
| 21 | + |
| 22 | +Second browser emulators type are browser controllers. Those emulators aims |
| 23 | +to control the real browser. That's right, a program to control another program. |
| 24 | +Browser controllers simulate user interactions on browser and are able to |
| 25 | +retrieve actual information from current browser page. `Selenium`_ and `Sahi`_ |
| 26 | +are the two most famous browser controllers. The main advantage of browser |
| 27 | +controllers usage is the support for JS/AJAX interactions on page. Disadvantage |
| 28 | +is that such browser emulators require the installed browser, extra configuration |
| 29 | +and are usually much slower than headless counterparts. |
| 30 | + |
| 31 | +So, the easy answer is to choose the best emulator for your project and use |
| 32 | +its API for testing. But as we've already seen, both browser types have both |
| 33 | +advantages and disadvantages. If you choose headless browser emulator, you |
| 34 | +will not be able to test your JS/AJAX pages. And if you choose browser controller, |
| 35 | +your overall test suite will become very slow at some point. So, in real |
| 36 | +world we should use both! And that's why you need a **Mink**. |
| 37 | + |
| 38 | +**Mink** removes API differences between different browser emulators providing |
| 39 | +different drivers (read in :doc:`/guides/drivers` chapter) for |
| 40 | +every browser emulator and providing you with the easy way to control the |
| 41 | +browser (:doc:`/guides/session`), traverse pages |
| 42 | +(:doc:`/guides/traversing-pages`) or manipulate page elements |
| 43 | +(:doc:`/guides/manipulating-pages`). |
| 44 | + |
| 45 | +.. _Goutte: https://github.com/FriendsOfPHP/Goutte |
| 46 | +.. _Sahi: http://sahi.co.in/w/ |
| 47 | +.. _Selenium: http://seleniumhq.org/ |
0 commit comments