Fresh new PHP Library

44 views
Skip to first unread message

Alexandre Salomé

unread,
Nov 9, 2011, 3:19:08 PM11/9/11
to selenium-...@googlegroups.com
Hello community,

I created a PHP Library for Selenium : http://alexandre-salome.fr/blog/PHP-Selenium-Library

The main class (Browser.php) is generated from the iedoc.xml provided with the Selenium package.

The main advantage I think in this approach is that you can take benefit of IDE completion, and "magic" methods (assert, verify) are not generated, because they depend of "how" you want to use it.

Well, the reason of this message is first to share it with you, but more specifically for asking you how could I enhance this library ?

I'm not satisfied of file upload, for example: you need to specify a location on the server, or an URL. Isn't it possible to upload directly the file ?

Well, I want to improve this library because there is a big lack in PHP concerning Selenium, and the Selenium solution is, as far as I see, the more robust on the market.

Waiting for your advice on it,

Best regards,

Alexandre

Santiago Suarez Ordoñez

unread,
Nov 12, 2011, 5:13:58 PM11/12/11
to selenium-...@googlegroups.com
Hi Alexandre,

Thanks for sharing. I'm not a PHP guy, but I've used the PHPUnit_Selenium library a couple of times and would love to try out yours in the future.
Regards looking forward, I think the main thing you should be thinking about is Se2 and webdriver's API. Se2/Webdriver is where everything is currently being done and the PHP landscape there is still a little bit unclear.
Here's a blog post from Adam that from what I've seen best describes the situation. I think a great contribution would be to help making the current state of things better and clearer for new PHP users, either contributing to the best library out there or making a definitive one :)

Best,
Santi


--
You received this message because you are subscribed to the Google Groups "Selenium Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-developers/-/v2WQe_MdMnQJ.
To post to this group, send email to selenium-...@googlegroups.com.
To unsubscribe from this group, send email to selenium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-developers?hl=en.

Alexandre Salomé

unread,
Nov 13, 2011, 1:28:04 PM11/13/11
to selenium-...@googlegroups.com
Thanks for the feedback, it's was I expected: the library is already obsolete :)

I looked at the code from Adam, but his approach is not the approach I have on it (mainly coupled with PHPUnit).

I just want to have an independant library, usable anywhere. I started developing with the WebDriver approach; https://github.com/alexandresalome/PHP-Selenium/tree/webdriver.

For the moment, the only sample I can give is :

$client  = new Selenium\Client('http://localhost:4444/wd/hub');
$session = $client->createSession(new Selenium\Capabilities('firefox'));

$session->close();

It's a work in progress, I'll give you news.

Best regards,

Alexandre

Andreas Tolf Tolfsen

unread,
Nov 18, 2011, 5:33:11 AM11/18/11
to selenium-...@googlegroups.com
* Also sprach Alexandre Salomé <alexandr...@gmail.com>:

> It's a work in progress, I'll give you news.

You might want to have a look at how the Ruby bindings (and possibly the
Python bindings) are doing this. The Ruby bindings are currently
structured this way:

├── selenium
│   ├── client
│   ├── server.rb
│   ├── webdriver
│   │   ├── android
│   │   ├── chrome
│   │   ├── common
│   │   │   ├── action_builder.rb
│   │   │   ├── alert.rb
│   │   │   ├── driver.rb
│   │   │   ├── element.rb
│   │   │   ├── error.rb
│   │   │   ├── keyboard.rb
│   │   │   ├── keys.rb
│   │   │   ├── mouse.rb
│   │   │   ├── navigation.rb
│   │   ├── firefox
│   │   ├── ie
│   │   ├── iphone
│   │   ├── opera
│   │   ├── remote
│   └── webdriver.rb
├── selenium-client.rb
└── selenium-webdriver.rb

It implements the Selenium RC-related stuff in /selenium/client, and the
WebDriver/RemoteWebDriver implementations in /selenium/webdriver. IMO
it's a very well organized and structured set of bindings.

Alexandre Salomé

unread,
Dec 1, 2011, 7:23:06 AM12/1/11
to selenium-...@googlegroups.com
Thanks for the feedback.

The current tree is looking like this :
src
└── Selenium
    ├── Capabilities.php
    ├── Client.php
    ├── Message
    │   ├── Client
    │   │   ├── SessionCloseRequest.php
    │   │   ├── SessionCreateRequest.php
    │   │   └── SessionCreateResponse.php
    │   ├── ErrorResponse.php
    │   ├── Navigation
    │   │   ├── UrlGetRequest.php
    │   │   ├── UrlGetResponse.php
    │   │   └── UrlSetRequest.php
    │   └── Session
    │       ├── ScreenshotRequest.php
    │       ├── ScreenshotResponse.php
    │       ├── SourceRequest.php
    │       ├── SourceResponse.php
    │       ├── TitleRequest.php
    │       └── TitleResponse.php
    ├── Navigation.php
    └── Session.php

I'm working regularly on it, probably finished in the beginning of next year.

The README on this page gives you details about the current API.
Reply all
Reply to author
Forward
0 new messages