5

We need to write some automated UI Tests on a project which is done entirely in PHP Kohana Framework, all of our engineers have experience with PHP language but none in Java.

But there seems to be a short amount of alternatives regarding the use of phpunit with selenium server and no official support for PHP. If we use the class at phpunit's page we would be stuck with Selenium RC1 server and that's not something we would want as our site has a lot of ajax and dynamic content. We've read that there are 3 different projects that make use of selenium Json Wire protocol in order to give compatibility with webdriver options. But the facebook one seems incomplete, even send keys are not implemented but looks flexible to add our own code and functionality. The chibimagic webdriver has an awful convention (using underscores vs camel case) which would break our own conventions and we don't like it that much. We think Lukasz Kolczynski class is the best of them but having to rely an important project to one single guy who could leave the project doesn't seem as a smart option.

What would you do if this was your project? we can't afford a QA engineer right now so two of our developers will write the tests for the moment and they know nothing of Java, they would require training in the language and the tools and looks like a good long term option but a very costly one. A lot of people seems to have this same question but I haven't heard yet a good answer.

markdrake
  • 624
  • 7
  • 12

4 Answers4

1

In the end what we decided to do was to create our own library to interact with the Selenium Json Wire Protocol and share it to the community.

We aimed to make it as similar as possible with the examples from other language official libraries so any example from Java would have a very similar syntax in php.

Here's the link, hope it helps someone else: https://github.com/Nearsoft/PHP-SeleniumClient

If you like it share it, get involved, fork it or do as you please.

Regards, Mark.

markdrake
  • 624
  • 7
  • 12
  • Is your webdriver implementation complete? I.e. are you comfortable claiming it is the best of the five(!) available PHP implementations, for any developer, not just you? (It may be a good idea to add a page to the github project advocating it, rather than try to squeeze an answer into a comment here :-) – Darren Cook Jun 01 '12 at 06:02
  • P.S. I said "five", as the fifth I know of is a branch of php-webdriver-bindings at https://github.com/daluu/php-webdriver-bindings. It adds WebDriverBackedSelenium, among other things. – Darren Cook Jun 01 '12 at 06:04
  • It is as complete as we needed, most of the basic functions are implemented and tested. We checked all other implementations and we didn't like what we saw. We decided to make it fully OOP, use namespaces, autoloaders and a nearly identical syntax from the examples of seleniumhq.org. I can't tell you if it's the best or not, you as users will tell us. Regards. – markdrake Jun 01 '12 at 16:55
1

We have Selenium tests using the V1 server now and haven't had a chance to investigate the options. I would expect the PHP web-driver projects to improve over time and would probably start there since you'll be up and running quickly.

As for using Java, the syntax is extremely similar to PHP, and the test code itself won't rely too much on Java-specifics beyond the Selenium API. Setting up the tools can be a PITA, but you should be able to find plenty of help online for that. Still, introducing a new language just for testing seems like a risk best avoided if possible.

David Harkness
  • 35,992
  • 10
  • 112
  • 134
1

I would still investigate on java.

Selenium in Java is very very easy and even more is WebDriver. Just Google the tutorials, your engineers will be able to reproduce soon.

Suggested tools: Eclipse, JUnit, Selenium 2

Arian
  • 3,183
  • 5
  • 30
  • 58
0

Perhaps a javascript testing framework would work?
You can do UI tests with a javascript framework and your developers should know javascript.

See this thread.

Community
  • 1
  • 1
Anders
  • 15,227
  • 5
  • 32
  • 42