Open
Description
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?
Activity
robocoder commentedon Jun 19, 2014
Theoretically, this is possible.
In lieu of aspects for cross cutting concerns, I'm not opposed to this.
aik099 commentedon Jun 19, 2014
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.
robocoder commentedon Jun 28, 2017
Linking to https://github.com/php-fig/fig-standards/blob/master/proposed/event-manager.md
robocoder commentedon Jul 6, 2021
This is now PSR-14.
Interfaces require PHP 7.2+
robocoder commentedon Mar 15, 2022
reference:
https://github.com/seleniumhq/selenium/blob/trunk/rb/lib/selenium/webdriver/support/abstract_event_listener.rb
robocoder commentedon Dec 9, 2023
Brainstorming:
As for the event object, at minimum:
Stumbling blocks:
So, I think we should be identifying the webdriver command before calling AbstractWebDriver::curl(). This is complicated by the commands that we declare via
@method
and use via__call()
.