php-webdriver icon indicating copy to clipboard operation
php-webdriver copied to clipboard

Support for EventListener

Open aik099 opened this issue 11 years ago • 6 comments

In Ruby's client for WebDriver protocol there is a way to place event listeners on various events on WebDriver side (see https://code.google.com/p/selenium/source/browse/rb/lib/selenium/webdriver/support/abstract_event_listener.rb, http://elementalselenium.com/tips/55-wrapper).

Is it possible to do the same in PHP WebDriver version?

aik099 avatar Jun 19 '14 08:06 aik099

Theoretically, this is possible.

In lieu of aspects for cross cutting concerns, I'm not opposed to this.

robocoder avatar Jun 19 '14 11:06 robocoder

What I want this for is to be able to set expectations for alert/prompt/confirm dialog before they happen. Ideally knowing if executed WebDriver command resulted in alert/prompt/confirm dialog opening without extra API call would be great as well.

aik099 avatar Jun 19 '14 12:06 aik099

Linking to https://github.com/php-fig/fig-standards/blob/master/proposed/event-manager.md

robocoder avatar Jun 28 '17 14:06 robocoder

This is now PSR-14.

Interfaces require PHP 7.2+

  • https://github.com/php-fig/event-dispatcher/tree/master/src

robocoder avatar Jul 06 '21 15:07 robocoder

reference: https://github.com/seleniumhq/selenium/blob/trunk/rb/lib/selenium/webdriver/support/abstract_event_listener.rb

robocoder avatar Mar 15 '22 20:03 robocoder