Reputation: 1711
if selenium RC is more powerfull than selenium IDE, why people use selenium IDE?, I don't understand. These both make tests, but one of them (RC) use another languages (with all the advantages). So, the real insterests in selenium is using RC, isn't it?. IDE is not so great, or I'm wrong?.
Another question is (I'm new in unit testing), when you use selenium RC, finally you use PHPunit o Junit (i.e.), so, why do you use selenium?, is not enough with phpunit only?
Upvotes: 1
Views: 337
Reputation: 38444
The Selenium Tools are actually three, not two:
Is a Firefox add-on, backed by Selenium RC. It's easy to learn, it creates testcases really quickly and is pretty clever for a testcase recording tool. It only posesses the strength of Selenese (the inbuilt commands) and (limited) JavaScript, so it's not very strong. But if you'll ever need to create a testcase quickly on a not-very-complicated webpage, it's the tool to use, because it's so easy to use and it's so quick. You'd have to write a hundred of lines in Java for Selenium RC (or WebDriver), but you can just click several times in IDE and you're done. No Eclipse/NetBeans needed, almost no programming skills needed. It's good for basic problems and static pages.
Gives you so much more. It is backed by pure JavaScript (which gets injected into the page every time), and has API in like six programming languages (C#, Java, Ruby, PHP, Python, Perl). It enables you to use full potential of the languages, so for instance we use Java to connect to the database, check its state and do check some preconditions. But it takes a lot more time, effort and knowledge to get things done.
Also, Selenium RC has been deprecated a year ago! There's no more development on it. It works, but it has some serious limitations that can't be overcome easily (JavaScript's Same origin policy, JavaScript's security policy to be unable to edit <input type='file' />
elements, a horribly unextensible API that doesn't really allow you to do all the modifications one might need, inability to handle onload
JS dialogs...).
Is the successor of Selenium RC. It really drives the browser from inside (DLL hooks for IE, addon for Firefox, driver provided by Google itself for Chrome etc.), has a very nice and clean API and overcomes all the problems Selenium RC has (except downloading a file, yet), it's being actively developed and enhanced. It is recommended to use Selenium WebDriver nowadays, not Selenium RC.
(omg, so much text just to convince you to use WebDriver instead of RC)
Regarding PHPUnit:
PHPUnit and Selenium do some VERY different things. PHPUnit (just like any xUnit framework out there) is made primarily for Unit testing, but Selenium is more of Black-box testing or System testing.
When you write your code, it's great to write tests in PHPUnit - those tests will test the internals of your project. They'll do it piece by piece, unit by unit. Selenium takes it from another angle - it tests what can be really seen and experienced by the user, it tests the whole project, how all the tiny things work together. It tests (among others!) your front-end in the browser itself, so you can try out your new changes in multiple browsers without having to move a finger. Selenium tests your whole apllication from outside, it looks at how it behaves when someone knocks on the door. PHPUnit tests the pieces of the application from inside - whether the right person goes to open the door and whether is didn't forget to take a key.
Both PHPUnit tests and Selenium tests are needed. The frameworks aren't really competitors, they supplement each other where one of them comes short.
Upvotes: 2
Reputation: 509
Selenium IDE doesn't require the knowledge of a programming language... and that's not bad. Sometimes someone just wants to set up a simple script, and Selenium IDE should make the work easy and simple.
The point of Selenium is not to replace JUnit and other frameworks for unit testing; its point is to control the browser so you can simulate user interactions with your sites or apps. I don't understand that part of the question. And the use of Selenium is not always linked to the use of JUnit, for example.
In the same vein of your question, why use Selenium RC and not Selenium 2 (WebDriver)?
Upvotes: 0