You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wondering about this,
You have a big list of methods here, in a big comment block, but the comment doesn't give an indication where these methods are implemented or how they can be used?
For example the string "findElementByCssSelector" doesn't exist in any other php files in the SeleniumClient dir besides in this comment block of WebDriver.php.
And they're all shown with the namespace SeleniumClient\WebElement, yet they work directly on the webdriver object, for example:
require "/path/to/SeleniumClient/WebDriver.php";
$driver = new SeleniumClient\WebDriver();
$el = $driver->findElementsByCssSelector($sel); #works
?
Hey @Lope, those methods are made available to a WebDriver object through the __call magic method. If there is a method called to a WebDriver and is not found, then this method catches the request and takes decision on what to do.
Hi @Lope, I added these changes a few months ago part of pull request #13. These magic methods are designed to aid auto-completion for developers using an IDE whilst reducing the amount of namespace imports and typing required, e.g.
# with magic methods
$webElement = $driver->findElementById("nav");
# without magic methods (requires additional namespace import)
$webElement = $driver->findElement(By::id("nav"));
The namespace \SeleniumClient\WebElement indicates the return type of the magic method. PhpStorm, NetBeans, Zend Studio are amongst popular IDEs that should understand this format.
Hi,
Just wondering about this,
You have a big list of methods here, in a big comment block, but the comment doesn't give an indication where these methods are implemented or how they can be used?
For example the string "findElementByCssSelector" doesn't exist in any other php files in the SeleniumClient dir besides in this comment block of WebDriver.php.
And they're all shown with the namespace SeleniumClient\WebElement, yet they work directly on the webdriver object, for example:
require "/path/to/SeleniumClient/WebDriver.php";
$driver = new SeleniumClient\WebDriver();
$el = $driver->findElementsByCssSelector($sel); #works
?
/**
*
*/
The text was updated successfully, but these errors were encountered: