!!

Welcome to Selenium Webdriver Forum

As a web user you can read and search through forum content. Once you have registered and signed you can post topics, post replies, set up watch lists, modify forum settings, and use private messaging.

Author Topic: Fresh new PHP Library  (Read 382 times)

Alexandre Salomé

  • Web User
Fresh new PHP Library
« on: April 12, 2012, 07:17:11 PM »
Hello community,
 
I created a PHP Library for Selenium :
 http://alexandre-salome.fr/blog/PHP-Selenium-Library
 
The main class (Browser.php<https://github.com/alexandresalome/PHP-Selenium/blob/master/src/Selen...>)
 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

  • Web User
Re: Fresh new PHP Library
« Reply #1 on: April 12, 2012, 07:17:29 PM »
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<http://element34.ca/blog/a-survey-of-the-php-and-selenium-landscape>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
 
On Wed, Nov 9, 2011 at 5:19 PM, Alexandre Salomé <alexandre.sal...@gmail.com
 

- Show quoted text -

Alexandre Salomé

  • Web User
Re: Fresh new PHP Library
« Reply #2 on: April 12, 2012, 07:17:41 PM »
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

Selenium Webdriver

Re: Fresh new PHP Library
« Reply #2 on: April 12, 2012, 07:17:41 PM »

Andreas Tolf Tolfsen

  • Web User
Re: Fresh new PHP Library
« Reply #3 on: April 12, 2012, 07:17:55 PM »
* Also sprach Alexandre Salomé <alexandre.sal...@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é

  • Web User
Re: Fresh new PHP Library
« Reply #4 on: April 12, 2012, 07:18:12 PM »
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.
 
To follow it: https://github.com/alexandresalome/PHP-Selenium/tree/webdriver
 The README on this page gives you details about the current API.

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
592 Views
Last post April 11, 2012, 10:09:00 PM
by Weber
1 Replies
405 Views
Last post April 11, 2012, 10:11:42 PM
by Weber
4 Replies
292 Views
Last post April 12, 2012, 06:25:08 PM
by Alexandre Salomé
2 Replies
435 Views
Last post April 15, 2012, 05:36:51 PM
by Brian Kitchener

Review www.seleniumwebdriver.com on alexa.com