Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriver not working, 2 required files not included #20

Open
ghost opened this issue Oct 29, 2013 · 2 comments
Open

WebDriver not working, 2 required files not included #20

ghost opened this issue Oct 29, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 29, 2013

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

@polosantiago
Copy link
Contributor

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

@ghost
Copy link
Author

ghost commented Oct 30, 2013

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant