php-selenium-client icon indicating copy to clipboard operation
php-selenium-client copied to clipboard

WebDriver not working, 2 required files not included

Open ghost opened this issue 12 years ago • 2 comments

This is the list of requires I have at the top of WebDriver.php and now its working

require_once DIR . '/By.php'; require_once DIR . '/DesiredCapabilities.php'; require_once DIR . '/Http/Exceptions.php'; require_once DIR . '/Http/HttpFactory.php'; require_once DIR . '/Http/HttpClient.php'; require_once DIR . '/TargetLocator.php'; require_once DIR . '/WebElement.php';

require_once DIR . '/Commands/Command.php'; #added require_once DIR . '/Commands/Commands.php'; #moved require_once DIR . '/WebDriverWait.php'; #added

ghost avatar Oct 29 '13 19:10 ghost

That works, you might as well use an autoloader mechanism as in here: https://github.com/Nearsoft/PHP-SeleniumClient/blob/master/SeleniumClientTest/bootstrap.php

You may see it is being referenced here: https://github.com/Nearsoft/PHP-SeleniumClient/blob/master/SeleniumClientTest/Demo/Demo1.php

polosantiago avatar Oct 29 '13 22:10 polosantiago

Hey dude,

Cool, thanks, looks interesting.

I'm not much of an OO fan.

So what if you have other classes that are in a different dir, your autoloader could interfere with another autoloader? Why not just include all the required files from the WebDriver?

It seems a bit weird that you've required most of the dependencies but then left out 2 critical ones? And then you've created an auto loader for those, but not included it with the main project dir? (your auto loader is inside the "SeleniumClientTest" dir which implies that dir is useful for people who want to test it. (I just wanted to use the SeleniumClient, and thats why I just used the SeleniumClient dir) It seems like you're making it more complicated than it needs to be with the auto loader. And if you really want to use the auto loader and leave out critical dependencies from the require list in WebDriver.php then why not just put the autoloader inside WebDriver.php? why fragment it? It wasn't very clear as a new dev using your project what file I should even include to start using it.

Thanks again for making and sharing it, I hope you consider my comments in the constructive nature they're intended :)

ghost avatar Oct 30 '13 11:10 ghost