Ah-ha moment reached. Will post for the next poor soul wandering in these desolate fields of confusion.
When Selenium says "Selenium 2", they like to say "Selenium 2 = Selenium server + WebDriver".
The trick for the PHPUnit person is the WebDriver part, which is not quite in PHPUnit. Selenium has written the WebDrivers in a few other languages, and there's third party ones for PHP which I haven't tried since I'm targeting PHPUnit for now. The WebDriver is basically a way of running around in the DOM and grabbing elements. It's got a good rundown at http://docs.seleniumhq.org/docs/03_webdriver.jsp.
When PHPUnit says "Selenium 2", they mean that they've written classes which do most of the stuff in a WebDriver, but they're not calling it a WebDriver, they're calling it Selenium 2.
Because of PHPUnit's homebrewed version, their methods are named a little differently than the Java or C# versions. This is why everyone is so excited about the PHPUnit test case because it makes it easy to guess what you're looking for after you've found the method you want at the webdriver docs.
Otherwise, apparently most of the other functionality in PHPUnit sticks to the original SeleniumTestCase
stuff; I've compiled a few links below to centralize my info somewhat. Selenium 1 is not "dead", but it is old. PHPUnit still uses a lot of architecture from its implementation of Selenium 1, and PHPUnit's Selenium 2 is not really that, but sort of Selenium 1++.
So, there's no reason to go hunting through the source, just try to match the PHPUnit test cases to the WebDriver docs. Also, a few methods in the tutorial for SeleniumTestCase
have changed names in Selenium2TestCase
, but fear not, the thing still works the same, just a little obfuscated.
You may ask, "Why not just use SeleniumTestCase
?" Well, it seems that support for other browsers requires the WebDriver, so if you want to get out of Firefox, you'll need Selenium2TestCase
(I could be wrong).
Here's some helpful links I found as I scraped away at this:
To solve my multiple-browser question above, it's still possible to use the static $browser
pattern from SeleniumTestCase
, but the browser
index has changed to browserName
:
public static $browsers = array(
array(
'name' => 'Internet Explorer',
'browserName' => 'iexplore', // not 'browser'
'host' => 'localhost',
'port' => 4444,
'timeout' => 30000,
),
};
Note that Phing does not support the <selenium>
tag if you're using an XML config.